Node.js V21.7.1 Documentation
Computes the Diffie-Hellman secret primarily based on a privateKey and a publicKey. Each keys will need to have the identical asymmetricKeyType, which have to be certainly one of ‘dh’ (for Diffie-Hellman), ‘ec’ (for ECDH), ‘x448’, or ‘x25519’ (for ECDH-ES). When data is a string, it will likely be encoded as UTF-8 earlier than being hashed. […]