Skip to content

Elixir module for encoding and decoding LEB128 (Little Endian Base 128) encoded numbers.

License

Notifications You must be signed in to change notification settings

diodechain/leb128

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LEB128

LEB128 is a library for encoding and decoding LEB128 encoded numbers. LEB128 is a variable-length encoding for integers that is used in the WebAssembly binary format.

https://en.wikipedia.org/wiki/LEB128

Installation

The package can be installed by adding leb128 to your list of dependencies in mix.exs:

def deps do
  [
    {:leb128, "~> 0.1.0"}
  ]
end

Usage

iex> LEB128.encode_unsigned(624_485)
<<0xE5, 0x8E, 0x26>>

iex> LEB128.decode_unsigned!(<<0xE5, 0x8E, 0x26>>)
{624_485, ""}

iex> LEB128.decode_unsigned!(<<0xE5, 0x8E>>)
{:error, :incomplete}

About

Elixir module for encoding and decoding LEB128 (Little Endian Base 128) encoded numbers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages