From: yomguy Date: Mon, 5 Mar 2012 12:38:34 +0000 (+0100) Subject: add time based md5 key tool X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=0277a47487773b7e2c1dde41c0a5fd4a79c84f4a;p=tools.git add time based md5 key tool --- diff --git a/various/make_id.py b/various/make_id.py new file mode 100644 index 0000000..486c86e --- /dev/null +++ b/various/make_id.py @@ -0,0 +1,14 @@ +#!/usr/bin/python + +import sys +import hashlib, time, base64 + +def makeSessionId(st): + m = hashlib.md5() + m.update('this is a test of the emergency broadcasting system') + m.update(str(time.time())) + m.update(str(st)) + return base64.encodestring(m.digest())[:-3].replace('/', '$') + +print makeSessionId(sys.argv[-1]) +