@bsv/wallet-toolbox-client
Version:
Client only Wallet Storage
26 lines • 1.78 kB
TypeScript
/**
* Convert a value to an encoded string if currently an encoded string or number[] or Uint8Array.
* @param val string or number[] or Uint8Array. If string, encoding must be hex. If number[], each value must be 0..255.
* @param enc optional encoding type if val is string, defaults to 'hex'. Can be 'hex', 'utf8', or 'base64'.
* @param returnEnc optional encoding type for returned string if different from `enc`, defaults to 'hex'. Can be 'hex', 'utf8', or 'base64'.
* @returns hex encoded string representation of val.
* @publicbody
*/
export declare function asString(val: string | number[] | Uint8Array, enc?: 'hex' | 'utf8' | 'base64', returnEnc?: 'hex' | 'utf8' | 'base64'): string;
/**
* Convert a value to number[] if currently an encoded string or number[] or Uint8Array.
* @param val string or number[] or Uint8Array. If string, encoding must be hex. If number[], each value must be 0..255.
* @param enc optional encoding type if val is string, defaults to 'hex'. Can be 'hex', 'utf8', or 'base64'.
* @returns number[] array of byte values representation of val.
* @publicbody
*/
export declare function asArray(val: string | number[] | Uint8Array, enc?: 'hex' | 'utf8' | 'base64'): number[];
/**
* Convert a value to Uint8Array if currently an encoded string or number[] or Uint8Array.
* @param val string or number[] or Uint8Array. If string, encoding must be hex. If number[], each value must be 0..255.
* @param enc optional encoding type if val is string, defaults to 'hex'. Can be 'hex', 'utf8', or 'base64'.
* @returns Uint8Array representation of val.
* @publicbody
*/
export declare function asUint8Array(val: string | number[] | Uint8Array, enc?: 'hex' | 'utf8' | 'base64'): Uint8Array;
//# sourceMappingURL=utilityHelpers.noBuffer.d.ts.map