Rename internal BigInt helper (#1244)
* Rename internal BigInt helper * Consistency
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
|
||||
import type { ToBnOptions } from '../types';
|
||||
|
||||
import { _BigInt, BI_ONE } from '../bi/consts';
|
||||
import { _1n, _n } from '../bi/consts';
|
||||
import { objectSpread } from '../object/spread';
|
||||
|
||||
const U8_MAX = _BigInt(256);
|
||||
const U16_MAX = _BigInt(256 * 256);
|
||||
const U8_MAX = _n(256);
|
||||
const U16_MAX = _n(256 * 256);
|
||||
|
||||
function xor (input: Uint8Array): Uint8Array {
|
||||
const result = new Uint8Array(input.length);
|
||||
@@ -59,6 +59,6 @@ export function u8aToBigInt (value: Uint8Array, options: ToBnOptions = {}): bigi
|
||||
: value;
|
||||
|
||||
return isNegative
|
||||
? ((toBigInt(xor(u8a)) * -BI_ONE) - BI_ONE)
|
||||
? ((toBigInt(xor(u8a)) * -_1n) - _1n)
|
||||
: toBigInt(u8a);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user