/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# ref: http://mylesbraithwaite.com/journal/2007/10/secret-key/ def secret_key(l=32): from string import letters, digits, punctuation from random import choice from datetime import datetime d = datetime.strftime(datetime.now(), '%Y%m%d%H%M%S%f') h = '%s%s%s%s' % (letters, digits, punctuation, d) s = ''.join([choice(h) for i in range(l)]) return s
URL: http://www.alejandrob.com.ar/