on master help sign in
Merge pull request #31 from prikhi/master

[#22] Document Difference Between randomIO & nextRandom

commit2199d3e24c8d44612bc597b4e47717c49d2130b3 authorHerbert Valerio Riedel <hvr@gnu.org> dateWed 21 Jun 2017, 18:58 (9 years ago) parentd6871e4953aef9
3 files changed+8−6
uuid-types/Data/UUID/Types/Internal.hs+3−3 uuid/Data/UUID.hs+3−2 uuid/Data/UUID/V4.hs+2−1
uuid-types/Data/UUID/Types/Internal.hs+3−3
@@ -72,9 +72,9 @@ import System.Random
7272
7373
7474-- |The UUID type. A 'Random' instance is provided which produces
75−-- version 4 UUIDs as specified in RFC 4122. The 'Storable' and
76−-- 'Binary' instances are compatible with RFC 4122, storing the fields
77−-- in network order as 16 bytes.
75+-- insecure version 4 UUIDs as specified in RFC 4122. The 'Storable' and
76+-- 'Binary' instances are compatible with RFC 4122, storing the fields in
77+-- network order as 16 bytes.
7878data UUID
7979 = UUID
8080 {-# UNPACK #-} !Word32
uuid/Data/UUID.hs+3−2
@@ -14,8 +14,9 @@ printing Universally Unique Identifiers.
1414See <http://en.wikipedia.org/wiki/UUID> for the general idea.
1515See <http://tools.ietf.org/html/rfc4122> for the specification.
1616
17−* Random UUIDs may be generated using 'Data.UUID.V4.nextRandom' or
18−your favorite instance of 'System.Random.Random'.
17+* Use 'Data.UUID.V4.nextRandom' to generate secure random UUIDs, and your
18+favorite instance of 'System.Random.Random' for faster but insecure
19+generation of UUIDs.
1920
2021* We have an implementation of generating a UUID from the hardware
2122MAC address and current system time in "Data.UUID.V1".
uuid/Data/UUID/V4.hs+2−1
@@ -26,7 +26,8 @@ import Data.UUID.Types.Internal ( buildFromBytes )
2626import System.Entropy ( getEntropy )
2727import Data.ByteString ( unpack )
2828
29−-- | Generate a random UUID. Introduced in version 1.2.6.
29+-- | Generate a crytographically secure, random UUID. Introduced in version
30+-- 1.2.6.
3031nextRandom :: IO UUID
3132nextRandom = do
3233 [b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf]