UNPKG

expo-crypto-universal-web

Version:

Web implementation of expo-crypto-universal

2 lines (1 loc) 646 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("expo-crypto-universal");class s extends o.AbstractCryptoModule{getRandomValues(t){return crypto.getRandomValues(t)}async sha256Async(t){return new Promise((r,n)=>{crypto.subtle.digest("SHA-256",t).then(e=>r(new Uint8Array(e)),e=>n(e))})}async sha384Async(t){return new Promise((r,n)=>{crypto.subtle.digest("SHA-384",t).then(e=>r(new Uint8Array(e)),e=>n(e))})}async sha512Async(t){return new Promise((r,n)=>{crypto.subtle.digest("SHA-512",t).then(e=>r(new Uint8Array(e)),e=>n(e))})}}const y=new s;exports.WebCryptoModule=s;exports.webCryptoModule=y;