-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Some algorithms (such as SHAKE128) can generate an output of arbitrary length. For example, the following are all valid SHAKE128 hashes of the string hello
in UTF-8:
8eb4
8eb4b6a932f28033
8eb4b6a932f280335ee1a279f8c208a3
8eb4b6a932f280335ee1a279f8c208a349e7bc65daf831d302
(generated by the online hash calculator)
In particular, this code should work:
Multihash m = Multihash.fromHex("18028eb4");
Whereas it currently fails with this exception:
java.lang.IllegalStateException: Incorrect hash length: 2 != 32
at io.ipfs.multihash.Multihash.<init>(Multihash.java:162)
at io.ipfs.multihash.Multihash.deserialize(Multihash.java:218)
at io.ipfs.multihash.Multihash.deserialize(Multihash.java:223)
at io.ipfs.multihash.Multihash.fromHex(Multihash.java:273)
Metadata
Metadata
Assignees
Labels
No labels