Node.js crypto.randomUUID( ) Function Last Updated : 22 Apr, 2021 Comments Improve Suggest changes Like Article Like Report The crypto.randomUUID() is an inbuilt application programming interface of class Crypto within crypto module which is used to generate a random RFC 4122 Version 4 UUID. Syntax: const crypto.randomUUID([options]) Parameters: This function takes the disableEntropyCache as a parameter Return Value: This function returns a random RFC 4122 Version 4 UUID. Example 1: index.js <script> // Node.js program to demonstrate the // crypto.randomUUID() api // Importing crypto module const crypto = require('crypto') // getting a random RFC 4122 Version 4 UUID // by using randomUUID() method const val = crypto.randomUUID({disableEntropyCache : true}); // display the result console.log("RFC 4122 Version 4 UUID : " + val) </script> Run the index.js file using the following command. node index.js Output: RFC 4122 Version 4 UUID : 88368f2a-d5db-47d8-a05f-534fab0a0045 Example 2: index.js <script> // Node.js program to demonstrate the // crypto.randomUUID() api // Importing crypto module const crypto = require('crypto') // getting a random RFC 4122 Version 4 UUID // by using randomUUID() method console.log(crypto.randomUUID()) </script> Run the index.js file using the following command. node index.js Output: e2d3286f-2d8f-471a-bacb-1e5d28d8727e Reference: https://nodejs.org/dist/latest-v15.x/docs/api/crypto.html#crypto_crypto_randomuuid_options Comment More infoAdvertise with us Next Article Node.js crypto.randomUUID( ) Function rohitprasad3 Follow Improve Article Tags : Web Technologies Node.js NodeJS-function Node.js-crypto-module Similar Reads Node.js crypto.verify() Function The crypto.verify()  is a method of the inbuilt module of node.js crypto that is used to verify the signature of data that is hashed using different kinds of hashing functions Like SHA256 algorithm etc. Syntax: crypto.verify(algorithm, data, publicKey, signature) Parameters: algorithm: It is a stri 2 min read Node.js crypto.sign() Function Cryptography is the process of converting plain text into unreadable which is hashed from text and vice-versa and the crypto.sign() is used to create signature of data. Syntax: crypto.sign(algorithm, data, key)Parameters: This function accepts the following parameters: algorithm: It is a string-ty 3 min read Node.js crypto.setEngine() Function Node.js is a cross-platform, open-source back-end JavaScript runtime environment that uses the V8 engine to execute JavaScript code outside of a web browser. Node.js allows developers to utilize JavaScript to create command-line tools and server-side scripting, which involves running scripts on the 2 min read Node.js crypto.scryptSync( ) Function The crypto.scryptSync() is an inbuilt function which Provides a synchronous scrypt implementation in Node.js. scrypt is a password-based key derivation function. It is intended to be costly computationally plus memory-wise. So, the brute-force attacks are made unsuccessful. Syntax: crypto.scryptSync 3 min read Node.js crypto.hkdf() Function The crypto.hkdf() is  an inbuilt application programming interface of class Crypto within crypto module which is used to derive a key of the particular length. Syntax: const crypto.hkdf(digest, key, salt, info, keylen, callback) Parameters: This function takes the following arguments as the paramete 2 min read Collect.js | random() function The random() function as the name suggest it returns any random value from the collection. In JavaScript, the array is first converted to a collection and then the function is applied to the collection. Syntax: data.random(number) Parameters: This function accept a single parameter as mentioned abo 1 min read p5.js random() Function The random() function in p5.js is used to return a random floating point number between ranges given as the parameter. Syntax: random(Min, Max) or random(Array) Parameters: This function accepts three parameters as mentioned above and described below: Min: This is the lower bound of the random numbe 3 min read Node.js crypto.randomInt() Method The Crypto.randomInt method in Node.js is an inbuilt application programming interface of the crypto module which is used to create a random integer synchronously or asynchronously based on our usage. Syntax: crypto.randomInt([min, ] max [, callback]) Parameters: This method accepts three parameters 2 min read Node.js crypto.checkPrime() Function The crypto.checkPrime() is an inbuilt application programming interface of class Crypto within the crypto module which is used to check if the passed buffer object is prime or not. Syntax: const crypto.checkPrime(candidate[, options, [callback]])Parameters: This API takes the following arguments as 2 min read Node.js crypto.randomFill() Method The crypto.randomFill() method is same as crypto.randomBytes() method but the only difference is that here the first argument is buffer that will be filled and it also has a callback function passed as an argument. However, if a callback function is not available then the error is thrown. Syntax: cr 2 min read Like