UNPKG
@openpgp/tweetnacl
Version:
latest (1.0.4-2)
1.0.4-2
1.0.4-1
1.0.4-0
1.0.3
Port of TweetNaCl cryptographic library to JavaScript
tweetnacl.js.org
openpgpjs/tweetnacl-js
@openpgp/tweetnacl
/
crypto.js
6 lines
(5 loc)
•
251 B
JavaScript
View Raw
1
2
3
4
5
6
// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.
// See utils.ts for details.
import
*
as
nc
from
'node:crypto'
;
export
const
crypto = nc &&
typeof
nc ===
'object'
&&
'webcrypto'
in
nc ? nc.
webcrypto
:
undefined
;