readme: add example for chash

This commit is contained in:
Paul Miller 2023-09-07 21:44:46 +00:00
parent 7befd5f881
commit 6bcab6c24b
No known key found for this signature in database
GPG Key ID: 697079DA6878B89B

@ -315,6 +315,10 @@ type CHash = {
outputLen: number; outputLen: number;
create(): any; create(): any;
}; };
// example
function sha256(message: Uint8Array) { return _internal_lowlvl(message) }
sha256.outputLen = 32; // 32 bytes of output for sha2-256
``` ```
**Message hash** is expected instead of message itself: **Message hash** is expected instead of message itself: