mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2025-08-14 11:45:35 +00:00
feat: remove toBuffer from number
This commit is contained in:
@@ -25,17 +25,18 @@ class BigNumber {
|
||||
throw new TypeError('Unsupported value type.');
|
||||
}
|
||||
|
||||
toBEBuffer(length = undefined) {
|
||||
toBEBuffer(length) {
|
||||
const arr = this._n.toByteArray();
|
||||
if (length && arr.length > length)
|
||||
throw new Error('Number out of range.');
|
||||
while (length && arr.length < length)
|
||||
arr.unshift(0);
|
||||
return Buffer.from(arr);
|
||||
}
|
||||
if (length === undefined)
|
||||
return Buffer.from(arr);
|
||||
|
||||
toBuffer() {
|
||||
return Buffer.from(this._n.toByteArray());
|
||||
if (arr.length > length)
|
||||
throw new Error('Number out of range.');
|
||||
|
||||
while (arr.length < length)
|
||||
arr.unshift(0);
|
||||
|
||||
return Buffer.from(arr);
|
||||
}
|
||||
|
||||
toString(radix = 10) {
|
||||
|
Reference in New Issue
Block a user