Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing dependency on micromath. computing height with integers only #16

Closed
wants to merge 2 commits into from

Conversation

naps62
Copy link

@naps62 naps62 commented Jan 18, 2023

This reduces the overall dependency tree, which was only being used in computing the tree height.
It may also be benefitial in some environments (e.g.: zk) to be able to use integer math only

} else {
let val = micromath::F32(leaves_count as f32);
val.log2().ceil().0 as usize
let mut current: usize = leaves_count;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://github.com/antouhou/rs-merkle/pull/18/files for a more concise implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants