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

Add binprot shapes for std::collections::{BTreeMap, HashMap} #8

Merged
merged 1 commit into from
Dec 17, 2023

Conversation

base1172
Copy link
Contributor

This PR implements the BinProtShape trait for BTreeMap and HashMap, using the same digest calculation as in the Ocaml implementation.

Confirmed that the calculated digests for BTreeMap<i64, i64> and HashMap<i64, i64> match their Ocaml equivalents in utop:

utop # let digest = Bin_prot.Shape.eval_to_digest_string (Int.Table.bin_shape_t Int.bin_shape_t);;
val digest : string = "1fd943a5d8026fbd3e6746c972ab2127"
utop # let s = Bin_prot.Shape.eval_to_digest_string (Int.Map.bin_shape_t Int.bin_shape_t);;
val s : string = "ed73a010af8ffc32cab7411d6be2d676"

@LaurentMazare LaurentMazare merged commit 165b4d6 into LaurentMazare:main Dec 17, 2023
14 checks passed
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