bip322-js
Version:
A Javascript library that provides utility functions related to the BIP-322 signature scheme
20 lines (19 loc) • 661 B
TypeScript
/// <reference types="node" />
/**
* Class that implement Buffer-related utility functions.
*/
declare class BufferUtil {
/**
* Ensures the input is a Node.js Buffer.
* If the input is already a Buffer, it is returned unchanged.
* Otherwise, it wraps the Uint8Array with Buffer.from.
*
* This is useful when working with code that may use polyfilled
* Buffer-like objects in environments like the browser.
*
* @param val - The value to normalize as a Buffer.
* @returns A Buffer instance containing the same data.
*/
static ensureBuffer(val: Uint8Array | Buffer): Buffer;
}
export default BufferUtil;