New in version 2014.7.0.
Provides access to randomness generators.
salt.modules.mod_random.
get_str
(length=20)¶New in version 2014.7.0.
Returns a random string of the specified length.
CLI Example:
salt '*' random.get_str 128
salt.modules.mod_random.
hash
(value, algorithm='sha512')¶New in version 2014.7.0.
Encodes a value with the specified encoder.
CLI Example:
salt '*' random.hash 'I am a string' md5
salt.modules.mod_random.
shadow_hash
(crypt_salt=None, password=None, algorithm='sha512')¶Generates a salted hash suitable for /etc/shadow.
CLI Example:
salt '*' random.shadow_hash 'My5alT' 'MyP@asswd' md5
salt.modules.mod_random.
str_encode
(value, encoder='base64')¶New in version 2014.7.0.
CLI Example:
salt '*' random.str_encode 'I am a new string' base64