From 0277a47487773b7e2c1dde41c0a5fd4a79c84f4a Mon Sep 17 00:00:00 2001 From: yomguy Date: Mon, 5 Mar 2012 13:38:34 +0100 Subject: [PATCH] add time based md5 key tool --- various/make_id.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 various/make_id.py 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]) + -- 2.39.5