LookAtMySuitBot/js/node_modules/jose/dist/browser/runtime/digest.js

7 lines
237 B
JavaScript
Raw Normal View History

2023-12-24 20:08:39 -05:00
import crypto from './webcrypto.js';
const digest = async (algorithm, data) => {
const subtleDigest = `SHA-${algorithm.slice(-3)}`;
return new Uint8Array(await crypto.subtle.digest(subtleDigest, data));
};
export default digest;