Node.js built-in Crypto library, which provides a variety of encryption algorithms that can easily let us use cryptographic technology to solve problems in application development. Mainly supports Hash (Hash), HMAC (Key Hobs), Cipher, Decipher (Decoding), Sign (Signature), and Verify. Crypto English is the meaning of secret members.
The usage method is approximately as follows:Crypto.createhash (Algorithm) Specifies the encryption method
VAR CRYPTO = Require ("CRYPTO"); // Encryption Crypto.getHashes ()Hash.Update (data) Specifies the content (DATA)
Displays the internal supported encryption method.
Hash.Digest (“HEX”) to be encrypted, which can be HEX Binary or Base64.
- VAR CRYPTO = Require (“Crypto”); // Encrypted VAR A = Crypto.createhash (“MD5 “) .Update (” 12 “). DiGest (‘base64’); console.log (a)
The above is all the content of this article, I hope that everyone’s learning is helpful, and I hope you will support Tumi Clouds.