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.1.tbz
sha256=dc8669aa66f44f8423ced576911ec6bce1943565a99c1a6c6aa67e19db428a90
sha512=0ed3ccb5f352da278d247c11551c6eedcf29897f090a11684005c44d8e4f6a93bfc2fe78e3236a1c5f9e174d12c03bd8d0ace1a8e91ab03c26ba263df10a8442
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)"
>