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

      > :param string: string to be hashed
      > :return: an MD2 hash

      Example:
        >>> md2("test")
        dd34716876364a02d0195e2fb9ae2d1b
    """
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)

    if salt is not None and front and not back:
        obj = md2_hash.md2h(salt + string)
    elif salt is not None and back and not front:
        obj = md2_hash.md2h(string + salt)
    else:
        obj = md2_hash.md2h(string)
    return obj

      Create an MD2 hash from a given string

      > :param string: string to be hashed
      > :return: an MD2 hash

      Example:
        >>> md2("test")
        dd34716876364a02d0195e2fb9ae2d1b
    
Create an MD2 hash from a given string
> :param string: string to be hashed
> :return: an MD2 hash
Create an MD2 hash from a given string > : param string : string to be hashed > : return : an MD2 hash
def md2(string, salt=None, front=False, back=False, **placeholder):
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)
    if salt is not None and front and not back:
        obj = md2_hash.md2h(salt + string)
    elif salt is not None and back and not front:
        obj = md2_hash.md2h(string + salt)
    else:
        obj = md2_hash.md2h(string)
    return obj
def md2 ( string , salt = None , front = False , back = False , ** placeholder ) : if type ( string ) is unicode : string = lib . settings . force_encoding ( string ) if salt is not None and front and not back : obj = md2_hash . md2h ( salt + string ) elif salt is not None and back and not front : obj = md2_hash . md2h ( string + salt ) else : obj = md2_hash . md2h ( string ) return obj
Create an MD2 hash from a given string
> :param string: string to be hashed
> :return: an MD2 hash
Create an MD2 hash from a given string > : param string : string to be hashed > : return : an MD2 hash
"""
      Create an MD2 hash from a given string

      > :param string: string to be hashed
      > :return: an MD2 hash

      Example:
        >>> md2("test")
        dd34716876364a02d0195e2fb9ae2d1b
    """
string
salt
front
back
examples
None