# nv-buf-bi

> nv-buf-bi ======================= - pure js, get bigint sign AND data-byte-length - for WriteVarInt -> WriteZigZag using - normally USELESS, used for encode/decode

Latest version **1.0.5** (published 2023-05-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install nv-buf-bi
pnpm add nv-buf-bi
yarn add nv-buf-bi
bun add nv-buf-bi
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-05-25 |
| First published | 2023-05-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ihgazni2 |

## Links

- npm: https://www.npmjs.com/package/nv-buf-bi
- npm.io page: https://npm.io/package/nv-buf-bi

## Recent versions

- 1.0.5 (latest) — 2023-05-25
- 1.0.4 — 2023-05-25
- 1.0.3 — 2023-05-23
- 1.0.2 — 2023-05-23
- 1.0.1 — 2023-05-23

## README

nv-buf-bi
=======================
- pure js, get bigint sign  AND  data-byte-length
- for WriteVarInt -> WriteZigZag  using
- normally USELESS, used for encode/decode 

### refer to v8/src/objects/bigint.cc

        uint32_t BigInt::GetBitfieldForSerialization() const {
            static_assert(kMaxLength * kDigitSize <= LengthBits::kMax);
            int bytelength = length() * kDigitSize;
            return SignBits::encode(sign()) | LengthBits::encode(bytelength);
        } 


install
=======
- npm install nv-buf-bi

splitted
--------

- [npm install xxx](https://www.npmjs.com/package/xxx)

usage
=====
    
      const  x  = require("nv-buf-bi");
 

example
-------

###

        > x.get_encd_head(2n**(64n*4096n))
        32776
        > x.decd_encd_head(32776)
        { sign: 0, data_blen: 32776 }
        > 32776/8
        4097
        > 

###

        > var g = x.gen_body_if_pos(2n**64n)
        > g.next()
        { value: 0n, done: false }
        > g.next()
        { value: 1n, done: false }
        > g.next()
        { value: undefined, done: true }
        >




METHODS
========




APIS
=======

            {
              count_if_pos: [Function: count_if_pos],
              data_byte_length_if_pos: [Function: data_byte_length_if_pos],
              count: [Function: count],
              data_byte_length: [Function: data_byte_length],
              get_encd_head: [Function: get_encd_head],
              decd_encd_head: [Function: decd_encd_head],
              gen_body_if_pos: [Function: gen_body_if_pos],
              gen_body: [Function: gen_body],
              use_with_get_var_int: [Function: use_with_get_var_int]
            }

LICENSE
=======
- ISC

---
_Source: https://npm.io/package/nv-buf-bi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
