-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | For creating, comparing, parsing and printing Universally Unique Identifiers
--   
--   This library is useful for creating, comparing, parsing and printing
--   Universally Unique Identifiers. See
--   <a>http://en.wikipedia.org/wiki/UUID</a> for the general idea.
@package uuid
@version 1.2.3


-- | RFC 4122 Version 1 UUID state machine.
module Data.UUID.V1

-- | Returns a new UUID derived from the local hardware MAC address and the
--   current system time. Is generated according to the Version 1 UUID
--   sepcified in RFC 4122.
--   
--   Returns nothing if the hardware MAC address could not be discovered.
nextUUID :: IO (Maybe UUID)
instance Show State
instance ByteSource MACSource


-- | This module implements Version 3 UUIDs as specified in RFC 4122.
--   
--   These UUIDs identify an object within a namespace, and are
--   deterministic.
--   
--   The namespace is identified by a UUID. Several sample namespaces are
--   enclosed.
module Data.UUID.V3

-- | Generate a <a>UUID</a> within the specified namespace out of the given
--   object.
--   
--   Uses an MD5 hash. The UUID is built from first 128 bits of the hash of
--   the namespace UUID and the name (as a series of Word8).
generateNamed :: UUID -> [Word8] -> UUID

-- | The namespace for DNS addresses
namespaceDNS :: UUID

-- | The namespace for URLs
namespaceURL :: UUID

-- | The namespace for ISO OIDs
namespaceOID :: UUID

-- | The namespace for X.500 DNs
namespaceX500 :: UUID


-- | This module implements Version 5 UUIDs as specified in RFC 4122.
--   
--   These UUIDs identify an object within a namespace, and are
--   deterministic.
--   
--   The namespace is identified by a UUID. Several sample namespaces are
--   enclosed.
module Data.UUID.V5

-- | Generate a <a>UUID</a> within the specified namespace out of the given
--   object.
--   
--   Uses a SHA1 hash. The UUID is built from first 128 bits of the hash of
--   the namespace UUID and the name (as a series of Word8).
generateNamed :: UUID -> [Word8] -> UUID

-- | The namespace for DNS addresses
namespaceDNS :: UUID

-- | The namespace for URLs
namespaceURL :: UUID

-- | The namespace for ISO OIDs
namespaceOID :: UUID

-- | The namespace for X.500 DNs
namespaceX500 :: UUID


-- | This library is useful for comparing, parsing and printing Universally
--   Unique Identifiers. See <a>http://en.wikipedia.org/wiki/UUID</a> for
--   the general idea. See <a>http://tools.ietf.org/html/rfc4122</a> for
--   the specification.
--   
--   For generating UUIDs, check out <a>V1</a>, <a>V5</a> and
--   <a>Random</a>.
module Data.UUID

-- | The UUID type. A <a>Random</a> instance is provided which produces
--   version 4 UUIDs as specified in RFC 4122. The <a>Storable</a> and
--   <a>Binary</a> instances are compatible with RFC 4122, storing the
--   fields in network order as 16 bytes.
data UUID

-- | Convert a UUID into a hypenated string using lower-case letters.
--   Example:
--   
--   <pre>
--   toString $ fromString "550e8400-e29b-41d4-a716-446655440000"
--   </pre>
toString :: UUID -> String

-- | If the passed in <a>String</a> can be parsed as a <a>UUID</a>, it will
--   be. The hyphens may not be omitted. Example:
--   
--   <pre>
--   fromString "c2cc10e1-57d6-4b6f-9899-38d972112d8c"
--   </pre>
--   
--   Hex digits may be upper or lower-case.
fromString :: String -> Maybe UUID

-- | Encode a UUID into a <tt>ByteString</tt> in network order.
toByteString :: UUID -> ByteString

-- | Extract a UUID from a <tt>ByteString</tt> in network byte order. The
--   argument must be 16 bytes long, otherwise <a>Nothing</a> is returned.
fromByteString :: ByteString -> Maybe UUID

-- | Covert a <a>UUID</a> into a sequence of <a>Word32</a> values. Usefull
--   for when you need to serialize a UUID and neither <a>Storable</a> nor
--   <a>Binary</a> are appropriate.
toWords :: UUID -> (Word32, Word32, Word32, Word32)

-- | Create a <a>UUID</a> from a sequence of <a>Word32</a>. The opposite of
--   <a>toWords</a>.
fromWords :: Word32 -> Word32 -> Word32 -> Word32 -> UUID

-- | Returns true if the passed-in UUID is the <a>nil</a> UUID.
null :: UUID -> Bool

-- | The nil UUID, as defined in RFC 4122. It is a UUID of all zeros.
--   <tt><a>null</a> u</tt> iff <tt><tt>u</tt> == <a>nil</a></tt>.
nil :: UUID
