Convert string to Uint8Array using sha256
acristoni opened this issue · comments
acristoni commented
sha256, showed here in the documentation:
const hashn = toHex(sha256("string"));
is not working properly, because sha256 is not accepting string as type, only Uint8Array.
These is the log error message:
_assert.ts:10 Uncaught (in promise) TypeError: Expected Uint8Array
at Object.bytes (_assert.ts:10:41)
at utils.js:49:27
at transfer (Transfer.jsx:22:31)
at HTMLUnknownElement.callCallback2 (react-dom.development.js:4164:14)
at Object.invokeGuardedCallbackDev (react-dom.d
and the code in the package from npm:
export declare const sha256: (msg: Uint8Array) => Uint8Array;