package git-kv
A Mirage_kv implementation using git
Install
Dune Dependency
Authors
Maintainers
Sources
git-kv-0.2.0.tbz
sha256=40de3010d82dd8e9229e7df09c0a649e81efd47e991ef6eb31ee0c713dfe400d
sha512=fe70e3d1ad0f2a07dfd594ea87b4a4fcc1fe5633ced537206e61d566a2f97061dd0b348b1e93b8de1196af5878f307b7a3f595b1b51b25da89ee918328b977d9
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 36
let 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)"
>