Portability | portable |
---|---|
Stability | experimental |
Maintainer | rhymoid@gmail.com |
Safe Haskell | None |
This library is an extension of the uuid library, allowing one to read and write 'little endian' encoded UUIDs. Some systems, for instance UEFI, chose to defy the simple format of RFC 4122 and use this format.
- toByteString :: UUID -> ByteString
- fromByteString :: ByteString -> Maybe UUID
- toWords :: UUID -> (Word32, Word32, Word32, Word32)
- fromWords :: Word32 -> Word32 -> Word32 -> Word32 -> UUID
- swapTupleEndianity :: (Word32, Word32, Word32, Word32) -> (Word32, Word32, Word32, Word32)
- swapListEndianity :: [Word8] -> [Word8]
Modified functions
toByteString :: UUID -> ByteStringSource
Encode a UUID into a ByteString
in little-endian-ish byte order.
fromByteString :: ByteString -> Maybe UUIDSource
Extract a UUID from a ByteString
in little-endian-ish byte order.
The argument must be 16 bytes long, otherwise Nothing
is returned.
toWords :: UUID -> (Word32, Word32, Word32, Word32)Source
Covert a UUID into a sequence of Word32
values. When stored in network
byte order, this tuple encodes the UUID in little-endian-ish byte order.
Endianity tools
swapTupleEndianity :: (Word32, Word32, Word32, Word32) -> (Word32, Word32, Word32, Word32)Source
Swaps the endianity of a UUID Word32
tuple.
swapListEndianity :: [Word8] -> [Word8]Source
Swaps the endianity of a UUID byte list, if the list is at least eight bytes long. Otherwise, it returns the original list.