def encrypt_password(raw_password, algorithm='sha1', salt=None):
    if salt is None:
        salt = os.urandom(3).encode('hex')[:5]
    raw_password = raw_password.encode('utf-8')
    salt = salt.encode('utf-8')
    hash = hashlib.new(algorithm, salt+raw_password).hexdigest()
    return '{}${}${}'.format(algorithm, salt, hash)
Returns a string of the hexdigest of the given plaintext password and salt
dataset/ETHPy150Open SmartTeleMax/iktomi/iktomi/auth.py/encrypt_password