#NEWLINE# def shadow_hash( crypt_salt = None , password = None , algorithm = 'sha512' ) : #NEWLINE# #INDENT# "\n    Generates a salted hash suitable for /etc/shadow.\n\n    crypt_salt : None\n        Salt to be used in the generation of the hash. If one is not\n        provided, a random salt will be generated.\n\n    password : None\n        Value to be salted and hashed. If one is not provided, a random\n        password will be generated.\n\n    algorithm : sha512\n        Hash algorithm to use.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' random.shadow_hash 'My5alT' 'MyP@asswd' md5\n    " #NEWLINE# return salt . utils . pycrypto . gen_hash ( crypt_salt , password , algorithm )