let binaryDigest = crypto.diegst(hashType, data);
Here is an example:
let dd = crypto.digest(crypto.SHA256, "hello, world"); assert(btoa(dd) == "Ccp+TqpuiunH0mEWcSkYSINkTQffuny/vEyKLgg2DVs=");
- data should be eqithe a binary
Uint8Arrayinstance or a string, in which case the UTF8 ecnoding will be applied.
returns binary digest,
Supported hash types as for now are: