Hi,
I need to generate hash from large files for one of my projects. Faced with size limitations and exception like “exceeded the instruction limit for single message execution”.
I have implemented the xxhash algorithm. It is currently available for motoko in two versions, 32 and 64 bits.
It allows me, to:
-
Easily check with hashes generated from other systems like xxhsum
-
Process large MB files in several times and thus simplify the management of the 2MB limit for parameters
-
Easily and quickly process data smaller than 2MB
This algorithm is not cryptographic but it has good performance and quality characteristics (more)
The source code is available gitlab
The tests show that the hashes are correct, I’m still trying to find ways to decrease the number of instructions consumed.
Your feedback is welcome