CRC32 or something like that in JUCE?

Just wondering if there’s a CRC32 function or similar in JUCE already. Couldn’t find anything, and the forum search also didn’t give me anything I could use.

The idea is to take a MemoryBlock and create some check-number that I can compare with another number to be sure that the file is not corrupted.

EG: piano_sound.sound - at the end of the file I add the CRC32 number, and load everything BUT that number into the MemoryBlock. Now I create the CRC32 from the memory block and check if both matches.

Cheers, WilliamK

Another option would add a parity bit to the stream, but that will make the file much larger. But at the same time, it will be easier and faster to load, I think…

There is one in ZipFile you could check out.

Rail

MD5, SHA-256, or Whirlpool?

https://docs.juce.com/master/group__juce__cryptography-hashing.html

Matt

Thanks guys, I forgot to search for MD5…

anyone know what flags to use to access the crc32 functions? seem to be undefined by default