Ñò ‚Ic@s7dZddkZddkZd„Zdd„ZdS(s Create random secrets. iÿÿÿÿNcCseyti|ƒSWnMtj oAdig}t|ƒD]}|ttidƒƒq9~ƒSXdS(s{ Return a string of the given length. Uses ``os.urandom`` if it can, or just pseudo-random numbers otherwise. tiN(tosturandomtAttributeErrortjointxrangetchrtrandomt randrange(tlengtht_[1]ti((s</usr/lib/python2.6/site-packages/paste/script/util/secret.pyt random_bytes s icCs@t|ƒidƒ}x dD]}|i|dƒ}qW|| S(sº Returns a random string of the given length. The string is a base64-encoded version of a set of random bytes, truncated to the given length (and without any newlines). tbase64s =R(R tencodetreplace(R tstbadchar((s</usr/lib/python2.6/site-packages/paste/script/util/secret.pyt secret_strings (t__doc__RRR R(((s</usr/lib/python2.6/site-packages/paste/script/util/secret.pyts