cluster.settings

cluster.settings <Object> execArgv <Array> list of string arguments passed to the Node.js executable. (Default=process.execArgv) exec <String> file path to worker file. (Default=process.argv[1]) args <Array> string arguments passed to worker. (Default=process.argv.slice(2)) silent <Boolean> whether or not to send output to parent's stdio. (Default=false) uid <Number> Sets the user identity of the process. (See setuid(2).) gid <Number> Sets the gr

crypto.createCipher()

crypto.createCipher(algorithm, password) Creates and returns a Cipher object that uses the given algorithm and password. The algorithm is dependent on OpenSSL, examples are 'aes192', etc. On recent OpenSSL releases, openssl list-cipher-algorithms will display the available cipher algorithms. The password is used to derive the cipher key and initialization vector (IV). The value must be either a 'binary' encoded string or a Buffer. The implementation of crypto.createCipher() derives keys usin

hash.digest()

hash.digest([encoding]) Calculates the digest of all of the data passed to be hashed (using the hash.update() method). The encoding can be 'hex', 'binary' or 'base64'. If encoding is provided a string will be returned; otherwise a Buffer is returned. The Hash object can not be used again after hash.digest() method has been called. Multiple calls will cause an error to be thrown.

ecdh.setPrivateKey()

ecdh.setPrivateKey(private_key[, encoding]) Sets the EC Diffie-Hellman private key. The encoding can be 'binary', 'hex' or 'base64'. If encoding is provided, private_key is expected to be a string; otherwise private_key is expected to be a Buffer. If private_key is not valid for the curve specified when the ECDH object was created, an error is thrown. Upon setting the private key, the associated public point (key) is also generated and set in the ECDH object.

cipher.final()

cipher.final([output_encoding]) Returns any remaining enciphered contents. If output_encoding parameter is one of 'binary', 'base64' or 'hex', a string is returned. If an output_encoding is not provided, a Buffer is returned. Once the cipher.final() method has been called, the Cipher object can no longer be used to encrypt data. Attempts to call cipher.final() more than once will result in an error being thrown.

Hmac

Class: Hmac The Hmac Class is a utility for creating cryptographic HMAC digests. It can be used in one of two ways: As a stream that is both readable and writable, where data is written to produce a computed HMAC digest on the readable side, or Using the hmac.update() and hmac.digest() methods to produce the computed HMAC digest. The crypto.createHmac() method is used to create Hmac instances. Hmac objects are not to be created directly using the new keyword. Example: Using Hmac objects as

cluster.disconnect()

cluster.disconnect([callback]) callback <Function> called when all workers are disconnected and handles are closed Calls .disconnect() on each worker in cluster.workers. When they are disconnected all internal handles will be closed, allowing the master process to die gracefully if no other event is waiting. The method takes an optional callback argument which will be called when finished. This can only be called from the master process.

worker.disconnect()

worker.disconnect() In a worker, this function will close all servers, wait for the 'close' event on those servers, and then disconnect the IPC channel. In the master, an internal message is sent to the worker causing it to call .disconnect() on itself. Causes .suicide to be set. Note that after a server is closed, it will no longer accept new connections, but connections may be accepted by any other listening worker. Existing connections will be allowed to close as usual. When no more conne

worker.suicide

worker.suicide <Boolean> Set by calling .kill() or .disconnect(), until then it is undefined. The boolean worker.suicide lets you distinguish between voluntary and accidental exit, the master may choose not to respawn a worker based on this value. cluster.on('exit', (worker, code, signal) => { if (worker.suicide === true) { console.log('Oh, it was just suicide\' – no need to worry'). } }); // kill worker worker.kill();

Certificate

Class: Certificate SPKAC is a Certificate Signing Request mechanism originally implemented by Netscape and now specified formally as part of HTML5's keygen element. The crypto module provides the Certificate class for working with SPKAC data. The most common usage is handling output generated by the HTML5 <keygen> element. Node.js uses OpenSSL's SPKAC implementation internally.