def hashPassword(sid, password):
 if (not isinstance(sid, unicode)):
  raise TypeError('The session identifier must be a unicode object')
 if (not isinstance(password, unicode)):
  raise TypeError('The password must be a unicode object')
 input = (u'%s%s' % (sid, password))
 return sha1(input.encode('utf-8')).hexdigest()

def hashPassword ( sid , password ) : if ( not isinstance ( sid , unicode ) ) : raise TypeError ( 'The session identifier must be a unicode object' ) if ( not isinstance ( password , unicode ) ) : raise TypeError ( 'The password must be a unicode object' ) input = ( u'%s%s' % ( sid , password ) ) return sha1 ( input . encode ( 'utf-8' ) ) . hexdigest ( )
module function to hash a password according to the pbkdf2 specification .