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