lib/algorithms/hashing_algs.py
def whirlpool(string, salt=None, front=False, back=False, **placeholder):
    """
      Create a WHIRLPOOL hash from a given string

      > :param string: string to be hashed
      > :return: a WHIRLPOOL hash

      Example:
        >>> whirlpool("test")
        b913d5bbb8e461c2c5961cbe0edcdadfd29f068225ceb37da6defcf89849368f8c6c2eb6a4c4ac75775d032a0ecfdfe8550573062b653fe92fc7b8fb3b7be8d6
    """
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)
    obj = hashlib.new("whirlpool")
    if salt is not None and front and not back:
        obj.update(salt + string)
    elif salt is not None and back and not front:
        obj.update(string + salt)
    else:
        obj.update(string)
    return obj.hexdigest()

      Create a WHIRLPOOL hash from a given string

      > :param string: string to be hashed
      > :return: a WHIRLPOOL hash

      Example:
        >>> whirlpool("test")
        b913d5bbb8e461c2c5961cbe0edcdadfd29f068225ceb37da6defcf89849368f8c6c2eb6a4c4ac75775d032a0ecfdfe8550573062b653fe92fc7b8fb3b7be8d6
    
Create a WHIRLPOOL hash from a given string
> :param string: string to be hashed
> :return: a WHIRLPOOL hash
Create a WHIRLPOOL hash from a given string > : param string : string to be hashed > : return : a WHIRLPOOL hash
def whirlpool(string, salt=None, front=False, back=False, **placeholder):
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)
    obj = hashlib.new("whirlpool")
    if salt is not None and front and not back:
        obj.update(salt + string)
    elif salt is not None and back and not front:
        obj.update(string + salt)
    else:
        obj.update(string)
    return obj.hexdigest()
def whirlpool ( string , salt = None , front = False , back = False , ** placeholder ) : if type ( string ) is unicode : string = lib . settings . force_encoding ( string ) obj = hashlib . new ( "whirlpool" ) if salt is not None and front and not back : obj . update ( salt + string ) elif salt is not None and back and not front : obj . update ( string + salt ) else : obj . update ( string ) return obj . hexdigest ( )
Create a WHIRLPOOL hash from a given string
> :param string: string to be hashed
> :return: a WHIRLPOOL hash
Create a WHIRLPOOL hash from a given string > : param string : string to be hashed > : return : a WHIRLPOOL hash
"""
      Create a WHIRLPOOL hash from a given string

      > :param string: string to be hashed
      > :return: a WHIRLPOOL hash

      Example:
        >>> whirlpool("test")
        b913d5bbb8e461c2c5961cbe0edcdadfd29f068225ceb37da6defcf89849368f8c6c2eb6a4c4ac75775d032a0ecfdfe8550573062b653fe92fc7b8fb3b7be8d6
    """
string
salt
front
back
examples
None