For Development HEAD DRAFTSearch (procedure/syntax/module):

Next: , Previous: , Up: Library modules - Utilities   [Contents][Index]

12.52 rfc.uuid - UUID

Module: rfc.uuid

This module implements UUID defined in RFC4122.

It provides generators of UUID version 1 and 4, and writer/parser of the string represenation of UUIDs.

Class: <uuid>

{rfc.uuid} Class of UUID instances. UUID instances are immutable.

Function: uuid-value uuid

{rfc.uuid} Returns the raw value of uuid as 16-element u8vector. You shouldn’t mutate the returned u8vector.

Function: uuid-version uuid

{rfc.uuid} Returns the version number of uuid.

Variable: uuid-comparator

{rfc.uuid} A comparator to compare and hash uuids. See Basic comparators.

Note: Equality of uuids can be tested with equal?.

Parameter: uuid-random-source

{rfc.uuid} We use PRNG to generate UUIDs. By default, we internally creates a random source and randomize it. You can alter the random source using parameterize. The value must be a srfi-27 random source (see Sources of random bits).

Function: uuid-random-source-set! random-source

{rfc.uuid} This procedure is deprecated. Use uuid-random-source parameter to customize random source to be used in uuid generation.

Function: uuid1 :optional node-id

{rfc.uuid} Generates a uuid with version 1 algorithm (timestamp and node id based). The optional node-id argument must be 48bit exact integer specifing the node ID (IEEE802 MAC address of the machine). If it is omitted, we generate a process-global random node ID (with the multicast bit set to 1, so that it won’t conflict with existing MAC address).

Function: uuid4

{rfc.uuid} Generates a uuid with version 4 algorithm (random numbers).

Function: nil-uuid

{rfc.uuid} Returns a nil-UUID (all bits zero).

Function: parse-uuid string

{rfc.uuid} Takes a string representation of UUID, parses it and returns an uuid instance. If the string isn’t a valid UUID representation, an error is thrown.

Other than XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX format, it recognizes the one with urn:uuid: prefix, the one enclosed by curly braces, and the one without hyphens.

Function: write-uuid uuid :optional port

{rfc.uuid} Writes out a string representation of uuid, in XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX format, to the given port. If the port is omitted, current output port is used.

Function: uuid->string uuid

{rfc.uuid} Returns a string representation of uuid, in XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX format.

Next: , Previous: , Up: Library modules - Utilities   [Contents][Index]

For Development HEAD DRAFTSearch (procedure/syntax/module):