Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Node.js crypto.getHashes() Method

  • Last Updated : 11 Oct, 2021

The crypto.getHashes() method is an inbuilt application programming interface of crypto module which is used to display the names of all the supported hash algorithms in an array.



Parameters: This method doesn’t accept any parameters.

Return Value: It returns the name of all the supported hash algorithms.

Below example illustrate the use of crypto.getHashes() method in Node.js:


// Node.js program to demonstrate the 
// crypto.getHashes() method
// Including crypto module
const crypto = require('crypto');
// Calling getHashes method
const hash = crypto.getHashes();
// Prints all the supported hash algorithms
console.log("The list of all the hash "
        + "algorithms are : ", hash);


The list of all the hash algorithms are :  [ 'RSA-MD4',
  'whirlpool' ]


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!