Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

bleb

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bleb

Better LEB128

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Better LEB128

bleb

RangeblebLEB128
0 - 1271 byte1 byte
128 - 163832 bytes2 bytes
16384 - 165112 bytes3 bytes
16512 - 20971513 bytes3 bytes
2097152 - 21136633 bytes4 bytes
...

Encoding

Basic Usage

import * as Bleb from "bleb"

console.log(Bleb.fromBigInt(1000n)) // [ 232, 6 ]

Decoding

Basic Usage

import * as Bleb from "bleb"

console.log(Bleb.toBigInt([ 232, 6 ])) // 1000n

Less-Basic Usage

import * as Bleb from "bleb"

// some data with bleb at byte offset 2
const u8View = new Uint8Array([ 177, 218, 232, 6, 197, 165, 75, 177 ])
const index = { $: 2 }

console.log(Bleb.toBigInt(u8View, index)) // 1000n
console.log(index) // { $: 4 }

Keywords

encoding

FAQs

Package last updated on 24 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts