package
module
Version:
v0.3.0
Opens a new window with list of versions in this module.
Published: Aug 12, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 21
Opens a new window with list of known importers.
README
¶
LEB128
Little Endian Base 128 | Variable-Length Code Compression
Usage
bs, _ := leb128.EncodeUnsigned(big.NewInt(200000))
// [192 154 12]
bi, _ := leb128.DecodeUnsigned(bytes.NewReader(bs))
// 200000
Uses
- LEB128 is used in the WebAssembly binary
encoding for all integer literals.
- LEB128 is used by Candid to serialise
types into a binary representation for transfer between services.
Documentation
¶
DecodeSigned converts the byte slice back to a signed integer.
DecodeUnsigned converts the byte slice back to an unsigned integer.
LEB128 represents an unsigned number encoded using (unsigned) LEB128.
EncodeSigned encodes a signed integer.
EncodeUnsigned encodes an unsigned integer.
SLEB128 represents a signed number encoded using signed LEB128.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.