public static MMHashtable CreateMMHashtable(FingerprintSignature fs, bool filterNoneRandomHashes = true) { Dictionary <uint, int[]> dict = CreateLookupDictionary(fs, filterNoneRandomHashes); MMHashtable mh = new MMHashtable(fs.SubFingerprintCount, fs.SubFingerprintCount); foreach (KeyValuePair <uint, int[]> entry in dict) { mh.Add(entry.Key, entry.Value); } //foreach byte[] byteArray = mh.HashtableAsByteArray; return(mh); }
public FingerprintSignature(object reference, long titelnummerTrackID, byte[] signature, byte[] mmHashtableData, long durationInMS) { this.titelnummerTrackID = titelnummerTrackID; this.reference = reference; if (this.signature != null) { Signature = signature; } this.durationInMS = durationInMS; if (mmHashtableData != null) { mmhSubFingerLookup = new MMHashtable(mmHashtableData); } }
public byte[] MMHashtable(bool compress = false) { if (mmhSubFingerLookup == null) { mmhSubFingerLookup = CreateMMHashtable(this); } byte[] byteArray = mmhSubFingerLookup.HashtableAsByteArray; if (compress) { byteArray = Lz4Net.Lz4.CompressBytes(byteArray, 0, byteArray.Length, Lz4Net.Lz4Mode.Fast); } return(byteArray); }