Skip to content

ISCC - Data-Code#

A similarity perserving hash for binary data (soft hash).

gen_data_code(stream, bits = 64) #

Create a similarity preserving ISCC Data-Code with the latest standard algorithm.

:param Stream stream: Input data stream. :param int bits: Bit-length of ISCC Data-Code (default 64). :return: ISCC Data-Code :rtype: dict

gen_data_code_v0(stream, bits = 64) #

Create an ISCC Data-Code with algorithm v0.

:param Stream stream: Input data stream. :param int bits: Bit-length of ISCC Data-Code (default 64). :return: ISCC object with Data-Code :rtype: dict

soft_hash_data_v0(stream) #

Create a similarity preserving Data-Hash digest

:param Stream stream: Input data stream. :return: 256-bit Data-Hash (soft-hash) digest used as body for Data-Code :rtype: bytes

DataHasher #

Incremental Data-Hash generator.

__init__(self, data = None) special #

Create a DataHasher

:param Optional[Data] data: initial payload for hashing.

push(self, data) #

Push data to the Data-Hash generator.

digest(self) #

Calculate 256-bit minhash digest from feature hashes.

code(self, bits = 64) #

Encode digest as an ISCC Data-Code unit.

:param int bits: Number of bits for the ISCC Data-Code :return: ISCC Data-Code :rtype: str

DataHasherV0 #

Incremental Data-Hash generator.

__init__(self, data = None) special #

Create a DataHasher

:param Optional[Data] data: initial payload for hashing.

push(self, data) #

Push data to the Data-Hash generator.

digest(self) #

Calculate 256-bit minhash digest from feature hashes.

code(self, bits = 64) #

Encode digest as an ISCC Data-Code unit.

:param int bits: Number of bits for the ISCC Data-Code :return: ISCC Data-Code :rtype: str