Skip to content

antp/vlq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vlq

An implementation of Variable Length Quantity

From wikipedia:

A variable-length quantity (VLQ) is a universal code that uses an arbitrary number of binary octets (eight-bit bytes) to represent an arbitrarily large integer. A VLQ is essentially a base-128 representation of an unsigned integer with the addition of the eighth bit to mark continuation of bytes.

Blog article about the code

Installation

def deps do
  [
    {:Vlq, github: "antp/Vlq"}
  ]
end

Not on Hex?

Nope, the code is not complicated. Do you really need to pull this library in?

Why not just take it and put it in your project and have one less dependency!

Usage

iex> Vlq.encode(128)
# <<129, 0>>

iex> Vlq.decode(<<129, 0>>)
# 128

About

An implementation of Variable Length Quantity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages