package git-kv
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A Mirage_kv implementation using git
Install
dune-project
Dependency
Authors
Maintainers
Sources
git-kv-0.2.4.tbz
sha256=1f14508253cbfdbf849cc650c15737714e73e900455dfb526145dd51c78eb6d3
sha512=3a6a5b79a2994bb2473c386a1f625dbe3f8a0c22b82c67c0fdbc90fe13004110661bf1d0f6b5d38ebaf3019b60feae915ac6c0f562ad0bb34da89821f9fe6259
doc/src/git-kv.mem/git_digest.ml.html
Source file git_digest.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36let hdr = function | `Blob -> Fmt.str "blob %Ld\000" | `Tree -> Fmt.str "tree %Ld\000" | `Tag -> Fmt.str "tag %Ld\000" | `Commit -> Fmt.str "commit %Ld\000" let ( % ) f g = fun x -> f (g x) let sha1 = let open Digestif in let feed_bigstring bstr ctx = SHA1.feed_bigstring ctx bstr in let feed_bytes buf ~off ~len ctx = SHA1.feed_bytes ctx ~off ~len buf in { Carton.First_pass.feed_bytes; feed_bigstring; serialize= SHA1.to_raw_string % SHA1.get; length= SHA1.digest_size; } let digest digest ctx fkind length serializer v = let open Carton.First_pass in let hdr = hdr fkind (length v) in let state = Encore.Lavoisier.emit v serializer in let rec go ctx = function | Encore.Lavoisier.Partial {buffer= str; off; len; continue} -> let ctx = digest.feed_bytes ~off ~len (Bytes.unsafe_of_string str) ctx in go ctx (continue ~committed:len) | Fail -> Fmt.failwith "Invalid Git object" | Done -> digest.serialize ctx |> Digestif.SHA1.of_raw_string in let ctx = digest.feed_bytes ~off:0 ~len:(String.length hdr) (Bytes.unsafe_of_string hdr) ctx in go ctx state
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>