lib/algorithms/hashing_algs.py
def postgres(string, salt=None, **placeholder):
    """
      Create a PostgreSQL hash, if no salt is provided, salt will be created

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

      Example:
        >>> postrges("test", "testing")
        md55d6685f9c56cdd04d635c7cbed612db3
    """
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)

    if salt is None:
        salt = lib.settings.random_salt_generator(use_string=True)[0]
    obj = hashlib.md5()
    obj.update(string + salt)
    data = obj.hexdigest()
    return "md5{}".format(data)

      Create a PostgreSQL hash, if no salt is provided, salt will be created

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

      Example:
        >>> postrges("test", "testing")
        md55d6685f9c56cdd04d635c7cbed612db3
    
Create a PostgreSQL hash, if no salt is provided, salt will be created
> :param string: string to be hashed
> :return: a PostgreSQL hash
Create a PostgreSQL hash if no salt is provided salt will be created > : param string : string to be hashed > : return : a PostgreSQL hash
def postgres(string, salt=None, **placeholder):
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)
    if salt is None:
        salt = lib.settings.random_salt_generator(use_string=True)[0]
    obj = hashlib.md5()
    obj.update(string + salt)
    data = obj.hexdigest()
    return "md5{}".format(data)
def postgres ( string , salt = None , ** placeholder ) : if type ( string ) is unicode : string = lib . settings . force_encoding ( string ) if salt is None : salt = lib . settings . random_salt_generator ( use_string = True ) [ 0 ] obj = hashlib . md5 ( ) obj . update ( string + salt ) data = obj . hexdigest ( ) return "md5{}" . format ( data )
Create a PostgreSQL hash, if no salt is provided, salt will be created
> :param string: string to be hashed
> :return: a PostgreSQL hash
Create a PostgreSQL hash if no salt is provided salt will be created > : param string : string to be hashed > : return : a PostgreSQL hash
"""
      Create a PostgreSQL hash, if no salt is provided, salt will be created

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

      Example:
        >>> postrges("test", "testing")
        md55d6685f9c56cdd04d635c7cbed612db3
    """
string
salt
examples
None