Copyright | (c) 20082012 Antoine Latter |
---|---|
License | BSD-style |
Maintainer | aslatter@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This library is useful for comparing, parsing and printing Universally Unique Identifiers. See http://en.wikipedia.org/wiki/UUID for the general idea. See http://tools.ietf.org/html/rfc4122 for the specification.
- Random UUIDs may be generated using
nextRandom
or your favorite instance ofRandom
. - We have an implementation of generating a UUID from the hardware MAC address and current system time in Data.UUID.V1.
- For name-based generation of UUIDs using SHA-1 hashing see Data.UUID.V5.
Documentation
The UUID type. A Random
instance is provided which produces
version 4 UUIDs as specified in RFC 4122. The Storable
and
Binary
instances are compatible with RFC 4122, storing the fields
in network order as 16 bytes.
Instances
Eq UUID Source # | |
Data UUID Source # | |
Defined in Data.UUID.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UUID -> c UUID # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UUID # dataTypeOf :: UUID -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UUID) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UUID) # gmapT :: (forall b. Data b => b -> b) -> UUID -> UUID # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UUID -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UUID -> r # gmapQ :: (forall d. Data d => d -> u) -> UUID -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UUID -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UUID -> m UUID # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UUID -> m UUID # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UUID -> m UUID # | |
Ord UUID Source # | |
Read UUID Source # | |
Show UUID Source # | |
Storable UUID Source # | |
Defined in Data.UUID.Internal | |
Binary UUID Source # | |
Random UUID Source # | |
toString :: UUID -> String Source #
Convert a UUID into a hypenated string using lower-case letters. Example:
toString $ fromString "550e8400-e29b-41d4-a716-446655440000"
toByteString :: UUID -> ByteString Source #
Encode a UUID into a ByteString
in network order.
fromByteString :: ByteString -> Maybe UUID Source #
Extract a UUID from a ByteString
in network byte order.
The argument must be 16 bytes long, otherwise Nothing
is returned.