nuka.utils
¶
nuka.utils.secret¶
-
class
nuka.utils.
secret
(value, alphabet=None, length=16)[source]¶ secret word generation:
>>> s = secret('something') >>> s.next() 'F)>x|o;J7sOhWV~F' >>> s.next() 'DP@:?|v%LaSB2v?b'
You can use your own alphabet:
>>> s = secret('something', alphabet='abc') >>> s.next() 'bbbbcaaacacbbcbb'
Or just ascii letters/digits:
>>> s = secret('something', alphabet='ascii') >>> s.next() 'FxoJ7sOhWVFYRN7v'
You can also change the length:
>>> s = secret('something', alphabet='ascii', length=3) >>> s.next() 'Fxo'