lib/algorithms/hashing_algs.py
def sha1_rounds(string, rounds=10, salt=None, front=False, back=False, **placeholder):
    """
      Create a SHA1 hash in given rounds, meaning re-hexdigest the hash with a already created
      hash value

      > :param string: string to be hashed
      > :param rounds: how many rounds the digest should go
      > :return: a hashed string

      Example:
        >>> sha1_rounds("test", rounds=3)
        84cb15079fe0d9e19e01a8526f9602be9fa10e3c
        >>> sha1_rounds("test", rounds=1000)
        2d69bdd6464a76fa735656b77e1869c626e9af8c
    """
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)
        if type(string) is unicode:
            string = lib.settings.force_encoding(string)
    obj = hashlib.sha1()
    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)
        hashed = obj.hexdigest()
    for _ in range(int(rounds) + 1):
        obj1 = hashlib.sha1()
        obj1.update(hashed)
        hashed = obj1.hexdigest()
    return hashed

      Create a SHA1 hash in given rounds, meaning re-hexdigest the hash with a already created
      hash value

      > :param string: string to be hashed
      > :param rounds: how many rounds the digest should go
      > :return: a hashed string

      Example:
        >>> sha1_rounds("test", rounds=3)
        84cb15079fe0d9e19e01a8526f9602be9fa10e3c
        >>> sha1_rounds("test", rounds=1000)
        2d69bdd6464a76fa735656b77e1869c626e9af8c
    
Create a SHA1 hash in given rounds, meaning re-hexdigest the hash with a already created
hash value


Create a SHA1 hash in given rounds meaning re - hexdigest the hash with a already created hash value
def sha1_rounds(string, rounds=10, salt=None, front=False, back=False, **placeholder):
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)
        if type(string) is unicode:
            string = lib.settings.force_encoding(string)
    obj = hashlib.sha1()
    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)
        hashed = obj.hexdigest()
    for _ in range(int(rounds) + 1):
        obj1 = hashlib.sha1()
        obj1.update(hashed)
        hashed = obj1.hexdigest()
    return hashed
def sha1_rounds ( string , rounds = 10 , salt = None , front = False , back = False , ** placeholder ) : if type ( string ) is unicode : string = lib . settings . force_encoding ( string ) if type ( string ) is unicode : string = lib . settings . force_encoding ( string ) obj = hashlib . sha1 ( ) 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 ) hashed = obj . hexdigest ( ) for _ in range ( int ( rounds ) + 1 ) : obj1 = hashlib . sha1 ( ) obj1 . update ( hashed ) hashed = obj1 . hexdigest ( ) return hashed
Create a SHA1 hash in given rounds, meaning re-hexdigest the hash with a already created
hash value
Create a SHA1 hash in given rounds meaning re - hexdigest the hash with a already created hash value
"""
      Create a SHA1 hash in given rounds, meaning re-hexdigest the hash with a already created
      hash value

      > :param string: string to be hashed
      > :param rounds: how many rounds the digest should go
      > :return: a hashed string

      Example:
        >>> sha1_rounds("test", rounds=3)
        84cb15079fe0d9e19e01a8526f9602be9fa10e3c
        >>> sha1_rounds("test", rounds=1000)
        2d69bdd6464a76fa735656b77e1869c626e9af8c
    """
string
rounds
salt
front
back
examples
None