# browsershots.org - Test your web design in different browsers # Copyright (C) 2007 Johann C. Rocholl # # Browsershots is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Browsershots is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . """ Create random nonces. """ __revision__ = "$Rev$" __date__ = "$Date$" __author__ = "$Author$" import md5 import random import time import os def random_md5(): """ Make a random 128bit hexadecimal authentication token. """ digest = md5.new() digest.update('%.50f' % random.random()) digest.update('%.20f' % time.time()) digest.update(os.urandom(16)) return digest.hexdigest() if __name__ == '__main__': print random_md5()