Crypto.randomBytes >= 0.1.4

Purpose

Generate a random string

Syntax

Crypto.randomBytes ( NumberbytesizeFunctioncallback );

Parameters

bytesize

callback

Return values

Examples

Get a random string

Crypto.randomBytes(10);
>>> "ù%d^$-µé#§" // Will actually return random bytes, not utf-8 friendly

Crypto.randomBytes(10, function(err, result) {
    
});

Comments

Abby

Hi there! Such a good short article, thank you!