node.js random salt genrator code example Example: how to generate a random salt in nodejs var buf = crypto.randomBytes(16);