UUID structure provides an implementation of
UUIDs (Universally Unique IDentifiers).
UUIDs, which are also known as GUIDs (Globally Unique IDentifiers),
are sequences of 16-bytes.
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
the abstract type of UUIDs.
val null : t
nullis the all-zeros UUID
val compare : t * t -> order
compare (uuid1, uuid2)does a byte-wise comparison of the two UUIDs and returns their order.
val same : t * t -> bool
same (uuid1, uuid2)does a byte-wise comparison of the two UUIDs and returns
trueis they are equal and
val hash : t -> word
hash uuidreturns a hash of the UUID.
val toString : t -> string
uuidas a string of the form
where each "`x`" is a lower-case hexadecimal digit. The first two digits in the string correspond to the first byte, and so on.
val fromString : string -> t option
fromString sconverts the string
s, which should be of the form returned by
SOME uuid, where
uuidis the UUID denoted by the string. Leading whitespace is ignored. If the string does not have the correct format, then
val toBytes : t -> Word8Vector.vector
toBytes uuidreturns the 16-element
Word8Vector.vectorvalue that represents
val fromBytes : Word8Vector.vector -> t
fromBytes bytestakes a 16-element vector of bytes and converts it to a UUID. The
Sizeexception 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).