Support for variable-length hashes
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- java
- Domain
- cryptography
Research direction
Start in Multihash.java at the constructor and deserialize/fromHex call path shown in the stack trace, then reproduce the failure with Multihash.fromHex("18028eb4"). Done means the SHAKE128 example with a 2-byte output is accepted instead of raising the fixed-length exception, while the existing deserialization path continues to work.
Written by the indexing model from the issue text.
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)
- Dominant language
- Java
- Stars
- 53
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from multiformats/java-multihash
-
Add blake3 support Open
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
multiformats/java-multihash#24 · 9 comments · 1 reaction ·
All issues in multiformats/java-multihash
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/rocketmq-dashboard#4860 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·