Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/libauth/src/lib/address/bech32.ts>regroupBits

An ultra-lightweight, zero-dependency JavaScript library for Bitcoin Cash, Bitcoin, and Bitauth applications.
Latest
variable regroupBits
import { regroupBits } from "https://deno.land/x/libauth@v2.0.0-alpha.9/src/lib/address/bech32.ts";

Given an array of integers, regroup bits from sourceWordLength to resultWordLength, returning a new array of integers between 0 and toWordLength^2.

Note, if bin is within the range of sourceWordLength and padding is true, this method will never error.

A.K.A. convertbits

type

(unnamed 0: { bin: number[] | Uint8Array; sourceWordLength: number; resultWordLength: number; allowPadding?: boolean; }) => unknown