package vlq

  1. Overview
  2. Docs
A simple library for encoding variable-length quantities.

Install

Dune Dependency

Authors

Maintainers

Sources

vlq-0.2.0.tbz
sha256=d955106eff0305b74ec4885b6e2c8de21eb0c0e7f0a942bda05c08e3974192bb
md5=919d71bd8644dd4290749810e96fb443

README.md.html

ocaml-vlq

A simple library for encoding variable-length quantities.

It currently supports writing a base64-encoded integer to a Buffer. Patches implementing other forms of encoding are welcome!

Example

let buf = Buffer.create 10 in
Vlq.Base64.encode buf 123456789;
Buffer.contents buf (* "qxmvrH" *)

let stream = Stream.of_string "qxmvrH" in
Vlq.Base64.decode stream (* 123456789 *)

This encoding can be used to generate JavaScript sourcemaps.

License

ocaml-vlq is MIT licensed, as found in the LICENSE file.

OCaml

Innovation. Community. Security.