jeudi 18 août 2016

Method `crypto.randomBytes()` in Node.js generates more bytes than specify in parameter `size`?

I have Node.js v6.3.1. Why the next code generates two characters instead of one?

crypto.randomBytes( 1 ).toString('hex')

Is one byte encodes two characters? Is it possible bug? (docs for randomBytes())




Aucun commentaire:

Enregistrer un commentaire