Mayank Agarwal has Published 373 Articles

agent.maxSockets Property in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:00:29

573 Views

The agent.maxSockets property defines the number of sockets that can be concurrently opened by the agent for each origin. By default, this value is set to Infinity. This is also a part of the 'http' module.Syntaxagent.maxSockets: numberParametersThe above function can accept the following Parameters −number – This defines the number of ... Read More

agent.maxFreeSockets Property in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:59:46

483 Views

The agent.maxFreeSockets property defines the number of sockets that are left open while in the free state. This is a part of the 'http' module interface.Syntaxagent.maxFreeSockets : numberParametersThe above function can accept the following parameters −number – This defines the number of sockets that can be kept open in the free ... Read More

crypto.randomBytes() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 11:59:03

4K+ Views

The crypto.randomBytes() generates cyprtographically strong pseudo-random data. This method will not be completed until there is sufficient entropy in the bytes created. But even after this it does not takes more than a few milliseconds. This method basically creates a few random bytes which are further used.Syntaxcrypto.randomBytes(size, [callback])ParametersThe above parameters ... Read More

crypto.pbkdf2Sync() Method in Node.js

Mayank Agarwal

Mayank Agarwal

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

1K+ 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

3K+ 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

3K+ 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

95 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

343 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

259 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

Advertisements