diff options
| author | polwex <polwex@sortug.com> | 2025-10-20 13:13:39 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-10-20 13:13:39 +0700 |
| commit | d21900836f89b2bf9cd55ff1708a4619c8b89656 (patch) | |
| tree | bb3a5842ae408ffa465814c6bbf27a5002866252 /ocaml/lib/mug.ml | |
neoinityes
Diffstat (limited to 'ocaml/lib/mug.ml')
| -rw-r--r-- | ocaml/lib/mug.ml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ocaml/lib/mug.ml b/ocaml/lib/mug.ml new file mode 100644 index 0000000..bf5eb32 --- /dev/null +++ b/ocaml/lib/mug.ml @@ -0,0 +1,17 @@ + + + (* Compute murmur3 hash of a noun *) + (* let compute_mug (noun : noun) : int32 = *) + (* let rec hash_noun n = *) + (* match n with *) + (* | Atom z -> *) + (* let bytes = Z.to_bits z in *) + (* murmur3_hash32 bytes *) + (* | Cell (h, t) -> *) + (* let h_mug = hash_noun h in *) + (* let t_mug = hash_noun t in *) + (* Combine hashes - simplified version *) + (* Int32.logxor h_mug t_mug *) + (* in *) + (* hash_noun noun *) + |
