sevm
Version:
A Symbolic Ethereum Virtual Machine (EVM) bytecode decompiler & analyzer library & CLI
23 lines (22 loc) • 892 B
TypeScript
/**
* Converts `data` into a suitable `Uint8Array` representation.
* When `data` is a `string`, it must be a hexadecimal string.
* The hexadecimal string may optionally start with `0x`.
*
* When `data` is an `ArrayLike<number>`, it is converted to a `Uint8Array`.
* If `data` is a `Uint8Array`, it is returned as-is.
*
* If `data` is a `string` and it is not a valid hexadecimal string,
* it throws an `Error`.
*
* @param data the data to convert to `Uint8Array`
* @returns the `Uint8Array` representation of `data`
*/
export declare function arrayify(data: Uint8Array | ArrayLike<number> | string): Uint8Array;
/**
* Converts `data` into a hexadecimal string without the `0x` prefix.
*
* @param data the `Uint8Array` to convert to a hexadecimal string
* @returns the hexadecimal string representation of `data`
*/
export declare function hexlify(data: Uint8Array): string;