util/utils.py
def n_split_hash(string: str, n: int, maxval: int = 255):
    """
    Hashes string into n values using simple algorithm
    :param string: String to hash
    :param n: Number of values
    :param maxval: Bound
    :return: Tuple of int values
    """
    part_len = len(string) // n
    parts = [string[i * part_len:(i + 1) * part_len] for i in range(n - 1)]
    parts.append(string[(n - 1) * part_len:])

    return tuple([
        reduce(lambda a, b: a * b % maxval, [ord(letter) for letter in sorted(part.replace(' ', ''))]) % maxval
        for part in parts
    ])

    Hashes string into n values using simple algorithm
    :param string: String to hash
    :param n: Number of values
    :param maxval: Bound
    :return: Tuple of int values
    
Hashes string into n values using simple algorithm
Hashes string into n values using simple algorithm
def n_split_hash(string: str, n: int, maxval: int = 255):
    part_len = len(string) // n
    parts = [string[i * part_len:(i + 1) * part_len] for i in range(n - 1)]
    parts.append(string[(n - 1) * part_len:])
    return tuple([
        reduce(lambda a, b: a * b % maxval, [ord(letter) for letter in sorted(part.replace(' ', ''))]) % maxval
        for part in parts
    ])
def n_split_hash ( string : str , n : int , maxval : int = 255 ) : part_len = len ( string ) // n parts = [ string [ i * part_len : ( i + 1 ) * part_len ] for i in range ( n - 1 ) ] parts . append ( string [ ( n - 1 ) * part_len : ] ) return tuple ( [ reduce ( lambda a , b : a * b % maxval , [ ord ( letter ) for letter in sorted ( part . replace ( ' ' , '' ) ) ] ) % maxval for part in parts ] )
Hashes string into n values using simple algorithm
Hashes string into n values using simple algorithm
"""
    Hashes string into n values using simple algorithm
    :param string: String to hash
    :param n: Number of values
    :param maxval: Bound
    :return: Tuple of int values
    """
Tuple of int values
Tuple of int values
string
str
String to hash
String to hash
n
int
Number of values
Number of values
maxval
int
None