@gandlaf21/cashu-crypto
Version:
Basic cashu crypto functions
14 lines (10 loc) • 363 B
text/typescript
import { bytesToHex } from '@noble/curves/abstract/utils';
export function bytesToNumber(bytes: Uint8Array): bigint {
return hexToNumber(bytesToHex(bytes));
}
export function hexToNumber(hex: string): bigint {
return BigInt(`0x${hex}`);
}
export function encodeBase64toUint8(base64String: string): Uint8Array {
return Buffer.from(base64String, 'base64');
}