Skip to content

Encoder and decoder for BER compressed integers

License

Notifications You must be signed in to change notification settings

bambr/lua-berint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SYNOPSIS

local berint = require('berint')

-- encode positive integer to BER
ber_encoded = berint.int2ber(value)

-- decode BER-encoded positive integer
value = berint.ber2int(ber_encoded)

-- decode BER-encoded positive integer at the start of binary data and get offset of the rest data
value, offset = berint.ber2int(binary_string)

-- decode BER-encoded positive integer at the midde of binary data and get offset of the rest data
value, offset = berint.ber2int(binary_string, ber_position)

BUILD

gcc -lm -shared -fPIC -std=c99 -O2 -o berint.so berint.c

About

Encoder and decoder for BER compressed integers

Resources

License

Stars

Watchers

Forks

Packages

No packages published