I’ve been messing around with ICRC3 and needed to do hashing of the transaction entries. I wrote my own library but then found that @nometa had done most of the work in the ic-certification library. I ported over his work, ICRC3ified it a bit, and added a sleb128 function for integers.
I found a few tests in the rust crate: https://github.com/dfinity/response-verification/blob/main/packages/ic-representation-independent-hash/src/representation_independent_hash.rs
…but I probably need some more, especially to test the sleb128 function.
If anyone can give it a quick review I’ll keep searching for tests and, eventually, push it to mops.
cc: @timo, @roman-kashitsyn , @quint , @mariop
I have sleb128 encoding in my numbers library
It was done with my candid encoding work
Did some with my ICP.NET work too
I can review yours if you want to roll your own though
The Sleb function worked like a charm(which is good because mine was not good).
I also added some of the test examples from the ICRC3 pseudo code that @bogwar published here: https://github.com/dfinity/ICRC-1/blob/icrc-3/standards/ICRC-3/HASHINGVALUES.md
(Would love to get that array example to work when we know the proper hash)
The version bumped to 0.1.1.