def shadow_hash(crypt_salt=None, password=None, algorithm='sha512'):
    return salt.utils.pycrypto.gen_hash(crypt_salt, password, algorithm)
Generates a salted hash suitable for /etc/shadow.
dataset/ETHPy150Open saltstack/salt/salt/modules/mod_random.py/shadow_hash