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

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

      Example:
        >>> crc64("test")
        bf3d60cae58eeb8e
        >>> crc64("test", use_hex=True)
        0xbf3d60cae58eeb8eL
    """
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)
    if salt is not None and front and not back:
        long_int = _crc64.crc64(salt + string)
    elif salt is not None and back and not front:
        long_int = _crc64.crc64(string + salt)
    else:
        long_int = _crc64.crc64(string)

    if not use_hex:
        return str(hex(long_int))[2:-1]
    else:
        return long_int

      Create a CRC64 hash from a given string

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

      Example:
        >>> crc64("test")
        bf3d60cae58eeb8e
        >>> crc64("test", use_hex=True)
        0xbf3d60cae58eeb8eL
    
Create a CRC64 hash from a given string
> :param string: string to be hashed
> :return: a CRC64 hash
Create a CRC64 hash from a given string > : param string : string to be hashed > : return : a CRC64 hash
def crc64(string, salt=None, front=False, back=False, use_hex=False, **placeholder):
    if type(string) is unicode:
        string = lib.settings.force_encoding(string)
    if salt is not None and front and not back:
        long_int = _crc64.crc64(salt + string)
    elif salt is not None and back and not front:
        long_int = _crc64.crc64(string + salt)
    else:
        long_int = _crc64.crc64(string)
    if not use_hex:
        return str(hex(long_int))[2:-1]
    else:
        return long_int
def crc64 ( string , salt = None , front = False , back = False , use_hex = False , ** placeholder ) : if type ( string ) is unicode : string = lib . settings . force_encoding ( string ) if salt is not None and front and not back : long_int = _crc64 . crc64 ( salt + string ) elif salt is not None and back and not front : long_int = _crc64 . crc64 ( string + salt ) else : long_int = _crc64 . crc64 ( string ) if not use_hex : return str ( hex ( long_int ) ) [ 2 : - 1 ] else : return long_int
Create a CRC64 hash from a given string
> :param string: string to be hashed
> :return: a CRC64 hash
Create a CRC64 hash from a given string > : param string : string to be hashed > : return : a CRC64 hash
"""
      Create a CRC64 hash from a given string

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

      Example:
        >>> crc64("test")
        bf3d60cae58eeb8e
        >>> crc64("test", use_hex=True)
        0xbf3d60cae58eeb8eL
    """
string
salt
front
back
use_hex
examples
None