haskell-hvr / uuid

A Haskell library for creating, printing and parsing UUIDs
http://hackage.haskell.org/package/uuid
61 stars 38 forks source link

another way to generate UUID without using getEntropy ? #49

Closed nhenin closed 5 years ago

nhenin commented 5 years ago

Hi, I'm heavily using nextRandom (V4) and I have exhausted the resources :

 /dev/urandom: openFd: resource exhausted (Too many open files)

I didn't know you were using getEntropy behind :

-- On some platforms this requies a file handle which can lead to resource
-- exhaustion in some situations.
getEntropy :: Int               -- ^ Number of bytes
           -> IO B.ByteString
getEntropy = bracket openHandle closeHandle . flip hGetEntropy

Can't we have something not using the file system ?