* @returns {Uint8Array} Byte array representation of the input decimal\r
*/\r
static toBytes (decimal: bigint | number | string, padding: number = 0): Uint8Array {\r
+ if (decimal == null) {\r
+ throw new TypeError(`Failed to convert '${decimal}' from decimal to bytes`)\r
+ }\r
if (typeof padding !== 'number') {\r
throw new TypeError('Invalid padding')\r
}\r
* @returns {string} Hexadecimal string representation of the input decimal\r
*/\r
static toHex (decimal: bigint | number | string, padding: number = 0): string {\r
+ if (decimal == null) {\r
+ throw new TypeError(`Failed to convert '${decimal}' from decimal to hex`)\r
+ }\r
if (typeof padding !== 'number') {\r
throw new TypeError('Invalid padding')\r
}\r