MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / fast_checksum

Function fast_checksum

aura/utils.py:343–351  ·  view source on GitHub ↗

Generates a fast checksum for the input data This function is not to be used for cryptography but rather for deduplication and similar use cases as the hashing is optimized for speed

(data: Union[bytes, str])

Source from the content-addressed store, hash-verified

341
342
343def fast_checksum(data: Union[bytes, str]) -> str:
344 """
345 Generates a fast checksum for the input data
346 This function is not to be used for cryptography but rather for deduplication and similar use cases as the hashing is optimized for speed
347 """
348 if type(data) == str:
349 data = data.encode("utf-8")
350
351 return hex(adler32(data))[2:] # Omit the `0x` at the start from `hex()`
352
353
354class Analyzer:

Callers 2

analyzeFunction · 0.85
node_StringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected