PHP code example of muvon / kiss-varint

1. Go to this page and download the library: Download muvon/kiss-varint library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

muvon / kiss-varint example snippets


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