Skip to content

KISS implementation of variant encode and decoder for int/uint

Notifications You must be signed in to change notification settings

Muvon/php-kiss-varint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-kiss-varint

KISS implementation of varint encode and decoder for int/uint

Basic usage

use Muvon\KISS\VarInt;

VarInt::packInt($value); // Pack value to a signed variable integer, little-endian
VarInt::packUint($value); // Pack value to signed variable integer, little-endian
VarInt::readInt($hex); // Unpack hex string as signed integer
VarInt::readUint($hex); // Unpack hax string as unsigned integer