#NEWLINE# def HashPassword( password , salt ) : #NEWLINE# #INDENT# 'Computes the hash of the given password using 1000 SHA512 iterations.' #NEWLINE# prf = ( lambda p , s : HMAC . new ( p , s , SHA512 ) . digest ( ) ) #NEWLINE# return base64 . b64encode ( PBKDF2 ( escape . utf8 ( salt ) , base64 . b64decode ( salt ) , count = 1000 , prf = prf ) )