package irmin
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Irmin, a distributed database that follows the same design principles as Git
Install
dune-project
Dependency
Authors
Maintainers
Sources
irmin-2.10.2.tbz
sha256=088741b619471c8198e74aaf9f4aeb4a9997abec8b9abcbfb3443fd27bfb433f
sha512=bbc03417d6eb87d99bee391c489d23a586b0a260e4c797f5e2465c3ab67cb627a9efa526097c1b89dd3339eafb8bad738c1cf0502e5c70355871ff7dbba324b9
doc/src/irmin/hash.ml.html
Source file hash.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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99(* * Copyright (c) 2013-2017 Thomas Gazagnaire <thomas@gazagnaire.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *) include Hash_intf module Make (H : Digestif.S) = struct type t = H.t external get_64 : string -> int -> int64 = "%caml_string_get64u" external swap64 : int64 -> int64 = "%bswap_int64" let get_64_little_endian str idx = if Sys.big_endian then swap64 (get_64 str idx) else get_64 str idx let short_hash c = Int64.to_int (get_64_little_endian (H.to_raw_string c) 0) let hash_size = H.digest_size let of_hex s = match H.consistent_of_hex s with | x -> Ok x | exception Invalid_argument e -> Error (`Msg e) let pp_hex ppf x = Fmt.string ppf (H.to_hex x) let t = Type.map ~pp:pp_hex ~of_string:of_hex Type.(string_of (`Fixed hash_size)) H.of_raw_string H.to_raw_string let hash s = H.digesti_string s end module Make_BLAKE2B (D : sig val digest_size : int end) = Make (Digestif.Make_BLAKE2B (D)) module Make_BLAKE2S (D : sig val digest_size : int end) = Make (Digestif.Make_BLAKE2S (D)) module SHA1 = Make (Digestif.SHA1) module RMD160 = Make (Digestif.RMD160) module SHA224 = Make (Digestif.SHA224) module SHA256 = Make (Digestif.SHA256) module SHA384 = Make (Digestif.SHA384) module SHA512 = Make (Digestif.SHA512) module BLAKE2B = Make (Digestif.BLAKE2B) module BLAKE2S = Make (Digestif.BLAKE2S) module Typed (K : S) (V : Type.S) = struct include K type value = V.t let pre_hash = Type.unstage (Type.pre_hash V.t) let hash v = K.hash (pre_hash v) end module V1 (K : S) : S with type t = K.t = struct type t = K.t let hash = K.hash let short_hash = K.short_hash let hash_size = K.hash_size let h = Type.string_of `Int64 let to_bin_key = Type.unstage (Type.to_bin_string K.t) let of_bin_key = Type.unstage (Type.of_bin_string K.t) let size_of = Type.Size.using to_bin_key (Type.Size.t h) let encode_bin = let encode_bin = Type.unstage (Type.encode_bin h) in fun e -> encode_bin (to_bin_key e) let decode_bin = let decode_bin = Type.unstage (Type.decode_bin h) in fun buf off -> let n, v = decode_bin buf off in ( n, match of_bin_key v with | Ok v -> v | Error (`Msg e) -> Fmt.failwith "decode_bin: %s" e ) let t = Type.like K.t ~bin:(encode_bin, decode_bin, size_of) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>