Review Request: Representationally Independent Hash - Motoko

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:

…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

1 Like

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


Nice! I’ll check it out.

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:

(Would love to get that array example to work when we know the proper hash)

The version bumped to 0.1.1.

1 Like