mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 04:27:59 +00:00
10 lines
326 B
JavaScript
10 lines
326 B
JavaScript
import { u8aToHex } from '../u8a/index.js';
|
|
import { nToU8a } from './toU8a.js';
|
|
/**
|
|
* @name nToHex
|
|
* @summary Creates a hex value from a bigint object.
|
|
*/
|
|
export function nToHex(value, { bitLength = -1, isLe = false, isNegative = false } = {}) {
|
|
return u8aToHex(nToU8a(value || 0, { bitLength, isLe, isNegative }));
|
|
}
|