objective categorical abstract machine language personal data server
65
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix mist util & description

futurGH fb97b3fb 8e59ed05

+4 -11
+2 -2
dune-project
··· 19 19 20 20 (package 21 21 (name mist) 22 - (synopsis "A Merkle Search Tree implementation") 22 + (synopsis "Atproto repo functionality") 23 23 (allow_empty) 24 24 (depends ocaml dune (cborl (>= 0.1.0)) (cid (>= 0.1.0)) lwt (multihash (>= 0.1.0)) (yojson (>= 3.0.0)) (alcotest :with-test))) 25 25 26 26 (package 27 27 (name ipld) 28 28 (synopsis "A DASL-compliant implementation of some IPLD formats") 29 - (description "Currently includes DAG-CBOR and CID v1") 29 + (description "Currently includes DAG-CBOR and CIDv1") 30 30 (allow_empty) 31 31 (depends ocaml dune (digestif (>= 1.2.0)) (multibase (>= 0.1.0)) (alcotest :with-test)))
+1 -1
mist/lib/dune
··· 1 1 (library 2 2 (name mist) 3 - (libraries ipld lwt multihash str yojson ppx_deriving_yojson.runtime) 3 + (libraries digestif ipld lwt multihash str yojson ppx_deriving_yojson.runtime) 4 4 (preprocess (pps ppx_deriving_yojson)))
+1 -8
mist/lib/util.ml
··· 1 1 let leading_zeros_on_hash (key : string) : int = 2 - let digest : string = Sha256.string key |> Sha256.to_bin in 2 + let digest = Digestif.SHA256.(digest_string key |> to_raw_string) in 3 3 let rec loop idx zeros = 4 4 if idx >= String.length digest then zeros 5 5 else ··· 41 41 42 42 let ensure_valid_key (key : string) : unit = 43 43 if not (is_valid_mst_key key) then raise (Invalid_argument "Invalid MST key") 44 - 45 - let encode_cbor_block (data : string) : bytes = 46 - let cbor_data = Cbor.encode_string data in 47 - let cbor_length = Bytes.length cbor_data in 48 - let length_bytes = Bytes.create 4 in 49 - Bytes.set_int32_le length_bytes 0 (Int32.of_int cbor_length) ; 50 - Bytes.cat length_bytes cbor_data