package granary
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Pure-OCaml SQL engine
Install
dune-project
Dependency
Authors
Maintainers
Sources
0.0.3.tar.gz
sha256=8b18780ea373be48301d9f333925860a2f9110fc0ac28684295118d72b65a67e
sha512=25ca3c9c5e2b528704a542502e0f37dc33ba003f65622d969b8c2b800778585f8ef0cf89b36e6679832e3993e8303aecddfc662742baf7044d6afe4a796b8f11
doc/src/granary.encoding/varint.ml.html
Source file varint.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 42let encode_uint64 buf n = let n = ref n in while Int64.compare (Int64.shift_right_logical !n 7) 0L <> 0 do let b = Int64.to_int (Int64.logor (Int64.logand !n 0x7FL) 0x80L) in Buffer.add_char buf (Char.chr (b land 0xFF)); n := Int64.shift_right_logical !n 7 done; Buffer.add_char buf (Char.chr (Int64.to_int !n land 0x7F)) ;; let decode_uint64 buf off = let result = ref 0L in let shift = ref 0 in let off = ref off in let cont = ref true in while !cont do let b = Char.code (Bytes.get buf !off) in incr off; let payload = Int64.of_int (b land 0x7F) in result := Int64.logor !result (Int64.shift_left payload !shift); shift := !shift + 7; if b land 0x80 = 0 then cont := false done; !result, !off ;; let zigzag_encode n = Int64.logxor (Int64.shift_left n 1) (Int64.shift_right n 63) let zigzag_decode n = Int64.logxor (Int64.shift_right_logical n 1) (Int64.neg (Int64.logand n 1L)) ;; let encode_int64 buf n = encode_uint64 buf (zigzag_encode n) let decode_int64 buf off = let u, off = decode_uint64 buf off in zigzag_decode u, off ;; [@@@ai_disclosure "ai-generated"] [@@@ai_model "claude-opus-4-7"] [@@@ai_provider "Anthropic"]
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>