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