Mayank Agarwal has Published 380 Articles

crypto.pbkdf2Sync() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:57:51

850 Views

The crypto.pbkdf2Sync(), also known as Password-Based Key Derivation function 2, provides a synchronous implementation of the derivative function. A key is derived by using the Hmac digest of a specified algorithm from password, salt and iterations. This will create the key in a sync process.Syntaxcrypto.createHmac(algorithm, key, [options])ParametersThe above parameters are ... Read More

crypto.pbkdf2() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:57:19

1K+ Views

The crypto.pbkdf2(), also known as Password-Based Key Derivation function, provides an asynchronous implementation of the derivative function. A key is derived by using the Hmac digest of a specified algorithm from password, salt and iterationsSyntaxcrypto.createHmac(algorithm, key, [options])ParametersThe above parameters are described as below −password – Password defined for getting key of ... Read More

crypto.createHmac() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:56:45

2K+ Views

The crypto.createHmac() method will create a Hmac object and then return it. THis Hmac uses the passed algorithm and key. The optional options will be used for controlling the stream behaviour. The key defined will be the HMAC key used for generating cryptographic HMAC hash.Syntaxcrypto.createHmac(algorithm, key, [options])ParametersThe above parameters are ... Read More

crypto.createHash() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:56:11

2K+ Views

The crypto.createHash() method will create a hash object and then return it. THis hash object can be used for generating hash digests by using the given algorithm. The optional options are used for controlling the stream behaviour. For some hash functions like XOF and 'shake256' the output length is used ... Read More

crypto.createDiffieHellman(primeLength, [generator]) Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:51:20

67 Views

The crypto.createDiffieHellmanGroup(primeLength, [generator]) method is used for creating a key exchange object that generates a prime number of primeLength bits using a numeric generator. Default value is 2 when the generator is not defined.Syntaxcrypto.createDiffieHelmmanGroup(primeLength, [generator])ParametersThe above parameters are described as below −primeLength – The number of prime bits that will be ... Read More

crypto.createDiffieHellman() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:50:54

243 Views

The above method creates a DiffieHellman key exchange object with the help of the supplied prime value and an optional specific generator. The generator argument can hold either a string, number or Buffer value. Default value for generator is 2.Syntaxcrypto.createDiffieHelmmanGroup(prime, [primeEncoding], [generator], [generatorEncoding]ParametersThe above parameters are described as below −prime – ... Read More

assert.deepStrictEqual() function in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:24:54

189 Views

The assert module provides a bunch of different functionalities that are used for function assertion. One of them is deepStrictEqual() function. This function is used to test the deep equality between the actual and expected parameters. An assertion error will be raised if the condition is not fulfilled.Syntaxassert.deepStrictEqual(actual, expected[, message])ParametersThe ... Read More

Logging in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:24:21

315 Views

Logging is a very essential part in any application whether it is made in Node.js or any other programming languages. Logging helps us to detect weird behaviours of an application along with real-time errors and exceptions. One should definitely put logical logs in their application. These logs help the user ... Read More

Integrating Express-rate-limit in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:23:20

305 Views

Rate-limiting is becoming important day by day to prevent websites from DOS & DDOS attacks. The rate-limiting prevents the system from any type of fake requests or other brute force attacks. Rate limiting limits the number of times an IP can make requests. The expressrate-limit is the npm package to ... Read More

Creating custom modules in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:22:48

2K+ Views

The node.js modules are a kind of package that contains certain functions or methods to be used by those who imports them. Some modules are present on the web to be used by developers such as fs, fs-extra, crypto, stream, etc. You can also make a package of your own ... Read More

Advertisements