dfinity / dfinity/cdk-rs

AsHashTree - what is it? Does it require data to be hashed?

Open
#668 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
230
Forks
103
Avg merge
2d 13h
Merged PRs (30d)
2

Description

From https://docs.rs/ic-certified-map/latest/ic_certified_map/trait.AsHashTree.html it's unclear the following:

For AsHashTree is it required that leafs are pseudorandom?

If I, for example, have an u64 value, transform is to U256 and further to [u8; 32] and then to Vec<u8> of length 32, will it be a suitable value for a leaf? It isn't a pseudo-random hash, because it has leading zeros.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked docs.rs AsHashTree trait documentation and determine whether leaf values must be pseudorandom or merely fixed byte values. Clarify whether a 32-byte representation of a u64 with leading zeros is suitable, then update the relevant documentation or API explanation so both questions have explicit answers.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.