Expand description
Node crypto module.
createHash(algo)→ aHashinstance (update(...).digest(enc)), backed by themd-5/sha1/sha2crates.createHmac(algo, key)→ anHmacinstance (update(...).digest(enc)), backed by thehmaccrate over the same digests.randomBytes,randomUUID,randomInt— CSPRNG output viagetrandom.
Hash/Hmac are plain objects tagged @@native = "Hash" / "Hmac"
accumulating input in a hidden @@data byte array until digest finalizes.
Constants§
- METHODS
- SUBTLE_
METHODS - The implemented half of
crypto.subtle. - WEBCRYPTO_
METHODS - The
webcrypto/globalThis.cryptomembers this runtime implements.
Functions§
- call
- cipher_
instance_ call Cipheriv/Decipherivinstance methods:update(data[,inEnc,outEnc])andfinal([outEnc]). Input is accumulated in@@data; the transform runs atfinal(CBC needs the full block/padding stream, soupdatereturns empty andfinalreturns the whole result — the standardupdate()+final()concatenation is byte-identical to node).- construct_
x509 new X509Certificate(pemOrDer)→ anX509Certificateinstance.- dh_
instance_ call DiffieHellmaninstance dispatch.- ecdh_
instance_ call ECDHinstance dispatch.- hmac_
instance_ call Hmacinstance methods:update(chainable) anddigest.- instance_
call Hashinstance methods:update(chainable) anddigest.- key_
object_ instance_ call KeyObjectinstance dispatch (export({type,format}),equals).- sign_
verify_ instance_ call Sign/Verifyinstance dispatch.- subtle_
call crypto.subtle.<method>.- x509_
instance_ call X509Certificateinstance dispatch (toString,toLegacyObject).