muvon/kiss-varint

varint read and pack convertion int/uint

0.3.0 2021-11-23 07:01 UTC

This package is auto-updated.

Last update: 2024-12-12 22:29:24 UTC


README

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