Files
tasq/node_modules/gun/sea/sha256.js
T
2026-04-09 19:01:53 +08:00

8 lines
289 B
JavaScript

var shim = require('./shim');
module.exports = async function(d, o){
var t = (typeof d == 'string')? d : await shim.stringify(d);
var hash = await shim.subtle.digest({name: o||'SHA-256'}, new shim.TextEncoder().encode(t));
return shim.Buffer.from(hash);
}