Documentation
¶
Overview ¶
Package crypto provides a Node.js-compatible crypto module backed by the Go standard library and golang.org/x/crypto. It is registered by jsruntime as both "crypto" and "node:crypto" when NodeJS mode is enabled.
The implementation covers the commonly used subset: hash/HMAC, random generation, PBKDF2/scrypt, symmetric ciphers (AES-CBC/CTR/ECB/GCM and ChaCha20-Poly1305), timing-safe comparison and RSA/ECDSA/Ed25519 sign/verify with PEM keys. See the jsruntime README for compatibility notes and known deviations.
Index ¶
Constants ¶
const ModuleName = "crypto"
ModuleName is the CommonJS name of the Node.js crypto compatibility module.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module implements the crypto module host services. It keeps the bridge runtime so asynchronous variants (randomBytes, pbkdf2, scrypt, sign, ...) can schedule callbacks on the JavaScript event loop.