From 232e0a9258b0acb7aea847fe7f74e8f7005fac33 Mon Sep 17 00:00:00 2001 From: nanotube Date: Wed, 10 Jan 2007 05:52:11 +0000 Subject: [PATCH] shove off some stuff to a utils file (for now, just password obfuscation) --- myutils.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 myutils.py diff --git a/myutils.py b/myutils.py new file mode 100644 index 0000000..7613c19 --- /dev/null +++ b/myutils.py @@ -0,0 +1,25 @@ +import zlib +import base64 + +def password_obfuscate(password): + return base64.b64encode(zlib.compress(password)) +def password_recover(password): + return zlib.decompress(base64.b64decode(password)) + + + + +#~ if __name__ == '__main__': + #some test code here. + #~ def hello(name="bla"): + #~ print "hello, ", name + + #~ myt = MyTimer(1.0, 5, hello, ["bob"]) + #~ myt.start() + #~ time.sleep(4) + #~ myt.cancel() + #~ print "next timer" + #~ myt = MyTimer(1.0, 0, hello, ["bob"]) + #~ myt.start() + #~ time.sleep(6) + #~ myt.cancel() -- 2.45.1