@types/lexicographic-integer
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

Installation

npm install --save @types/lexicographic-integer

Summary

This package contains type definitions for lexicographic-integer (https://github.com/substack/lexicographic-integer).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lexicographic-integer.

index.d.ts

/**
 * Return an array of byte values or a lexicographic hex string for an input integer.
 * @param n The input integer as a javascript number.
 * @param enc The encoding to use. Can be one of 'array' (default) or 'hex'.
 */
export function pack<T extends "hex" | "array" = "array">(
    n: number,
    enc?: T,
): T extends "hex" ? string : T extends "array" ? number[] : never;
/**
 * Convert an array of bytes returned by .pack() back into the original javascript number.
 * @param xs An array of bytes or a hex string.
 */
export function unpack(xs: number[] | string): number;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: none

Credits

These definitions were written by Carson Farmer.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/lexicographic-integer

Weekly Downloads

15

Version

1.1.3

License

MIT

Unpacked Size

3.79 kB

Total Files

5

Last publish

Collaborators

  • types