The UUID
structure provides an implementation of
UUIDs (Universally Unique IDentifiers).
UUIDs, which are also known as GUIDs (Globally Unique IDentifiers),
are sequences of 16bytes.
Synopsis
structure UUID
Interface
type t
val null : t
val compare : t * t > order
val same : t * t > bool
val hash : t > word
val toString : t > string
val fromString : string > t option
val toBytes : t > Word8Vector.vector
val fromBytes : Word8Vector.vector > t
Description
type t

the abstract type of UUIDs.
val null : t

null
is the allzeros UUID val compare : t * t > order

compare (uuid1, uuid2)
does a bytewise comparison of the two UUIDs and returns their order. val same : t * t > bool

same (uuid1, uuid2)
does a bytewise comparison of the two UUIDs and returnstrue
is they are equal andfalse
otherwise. val hash : t > word

hash uuid
returns a hash of the UUID.
val toString : t > string

toString uuid
formatsuuid
as a string of the form
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
where each "`x`" is a lowercase hexadecimal digit. The first two digits in the string correspond to the first byte, and so on.
val fromString : string > t option

fromString s
converts the strings
, which should be of the form returned bytoString
toSOME uuid
, whereuuid
is the UUID denoted by the string. Leading whitespace is ignored. If the string does not have the correct format, thenNONE
is returned. val toBytes : t > Word8Vector.vector

toBytes uuid
returns the 16elementWord8Vector.vector
value that representsuuid
. val fromBytes : Word8Vector.vector > t

fromBytes bytes
takes a 16element vector of bytes and converts it to a UUID. TheSize
exception is raised if the length of the vector is not exactly 16. Otherwise, there is no validity chechking of the UUID (i.e., the variant and type are not checked).