matchms.hashing module

Helper functions related to hashing.

matchms.hashing.metadata_hash(metadata: dict, hash_length: int = 20)[source]

Compute hash from metadata dictionary.

matchms.hashing.spectrum_hash(peaks: Fragments, hash_length: int = 20, mz_precision: int = 5, intensity_precision: int = 2)[source]

Compute hash from mz-intensity pairs of all peaks in spectrum. Method is inspired by SPLASH (doi:10.1038/nbt.3689).