uuid-0.1.0

Portabilityportable
Stabilityexperimental
Maintaineraslatter@gmail.com

Data.UUID

Description

Haskell bindings to libuuid. The library libuuid is available as a part of e2fsprogs: http://e2fsprogs.sourceforge.net/.

This library is useful for creating, comparing, parsing and printing Universally Unique Identifiers. See http://en.wikipedia.org/wiki/UUID for the general idea.

Synopsis

Documentation

data UUID Source

The UUID type. Represents 128-bits of identification.

fromString :: String -> Maybe UUIDSource

If the passed in String can be parsed as a UUID, it will be. The hyphens may not be omitted. Example:

  fromString "c2cc10e1-57d6-4b6f-9899-38d972112d8c"

Hex digits may be upper or lower-case.

toString :: UUID -> StringSource

Returns a String representation of the passed in UUID. Hex digits occuring in the output will be either upper or lower-case depending on system defaults and locale.

toStringUpper :: UUID -> StringSource

Returns a String representation of the passed in UUID. Hex digits occuring in the output will be upper-case.

toStringLower :: UUID -> StringSource

Returns a String representation of the passed in UUID. Hex digits occuring in the output will be lower-case.

generate :: IO UUIDSource

Creates a new UUID. If /dev/urandom is available, it will be used. Otherwise a UUID will be generated based on the current time and the hardware MAC address, if available.

generateRandom :: IO UUIDSource

Create a new UUID. If /dev/urandom is available, it will be used. Otherwise a psuedorandom generator will be used.

generateTime :: IO UUIDSource

Create a new UUID. The UUID will be generated based on the current time and the hardware MAC address, if available.

null :: UUID -> BoolSource

Returns True if the passed-in UUID is the null UUID.