Liking cljdoc? Tell your friends :D

multiformats.varint

Implementation of an MSB unsigned variable-size integer.

Unsigned integers are serialized 7 bits at a time, starting with the least-significant bits. The highest bit (msb) in each output byte indicates if there is a continuation byte.

https://github.com/multiformats/unsigned-varint

Implementation of an MSB unsigned variable-size integer.

Unsigned integers are serialized 7 bits at a time, starting with the
least-significant bits. The highest bit (msb) in each output byte indicates
if there is a continuation byte.

https://github.com/multiformats/unsigned-varint
raw docstring

decodeclj/s

(decode buffer)

Decode a byte array as a varint value. Returns the decoded value.

This is a shorthand for reading the bytes at the beginning of the array and ignoring any extra data.

Decode a byte array as a varint value. Returns the decoded value.

This is a shorthand for reading the bytes at the beginning of the array and
ignoring any extra data.
raw docstring

encodeclj/s

(encode value)

Encode a value as a sequence of varint bytes. Returns the encoded byte array.

Encode a value as a sequence of varint bytes. Returns the encoded byte
array.
raw docstring

read-bytesclj/s

(read-bytes data offset)

Read bytes from the byte array at the given offset. Returns a tuple with the decoded varint and the number of bytes read.

Read bytes from the byte array at the given offset. Returns a tuple with the
decoded varint and the number of bytes read.
raw docstring

write-bytesclj/s

(write-bytes value buffer offset)

Write a value as a varint to a byte array at the given offset. Returns the number of bytes written.

Write a value as a varint to a byte array at the given offset. Returns the
number of bytes written.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close