shove off some stuff to a utils file (for now, just password obfuscation)

nanotube [2007-01-10 05:52]
shove off some stuff to a utils file (for now, just password obfuscation)
Filename
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()
ViewGit