Why not use uuid? There's a node-uuid module available. On May 19, 1:25 pm, Dean Mao <dean...@gmail.com> wrote: > Yes, this thread will last until next year, when someone just tells us to > use the randomString() api and not try to reinvent the wheel. > > > > > > > > On Sat, May 19, 2012 at 1:02 AM, Jorge <jo...@jorgechamorro.com> wrote: > > On May 18, 2012, at 7:10 AM, Aleksander Adamowski wrote: > > > On Wednesday, August 3, 2011 12:15:32 PM UTC+2, Jorge wrote: > > >> Fromhttp://en.wikipedia.org/wiki//dev/random: "The intent is to > > serve as a cryptographically secure pseudorandom number generator, > > delivering output with entropy as large as possible. This is suggested for > > use in generating cryptographic keys for high-value or long-term protection" > > > >> $ node > > >> >function getRandomBytes (howMany) { > > >> var fs= require('fs'); > > >> var bytes= new Buffer(howMany); > > >> var fd= fs.openSync('/dev/random', 'r'); > > > > This is unnecessary, node.js crypto API has a > >http://nodejs.org/docs/v0.6.1/api/crypto.html#randomBytesfunction that > > uses OpenSSL RAND_bytes() to handle this task correctly. > > > <snip> > > > I wrote that on August 3, 2011, now look at the date of this: > > > $ git log --grep 'implement randomBytes' > > commit c4eaf7e5a90e0b923c5b1aff3ccef09c8ea064a9 > > Author: Ben Noordhuis <i...@bnoordhuis.nl> > > Date: Thu Sep 22 20:33:58 2011 +0200 > > > crypto: implement randomBytes() and pseudoRandomBytes() > > > :-P > > > Cheers, > > -- > > Jorge. > > > -- > > Job Board:http://jobs.nodejs.org/ > > Posting guidelines: > >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > You received this message because you are subscribed to the Google > > Groups "nodejs" group. > > To post to this group, send email to nodejs@googlegroups.com > > To unsubscribe from this group, send email to > > nodejs+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/nodejs?hl=en?hl=en
-- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en