chickadee » uuid-lib

uuid-lib

OSF DCE 1.1 UUID

Documentation

Wrapper for uuid/uuid.h procedures on macOS X, and Linux.

Operations

make-uuid

make-uuid #!optional METHODprocedure

Returns a new uuid, as uuid-generate, or a null-uuid as the default.

uuid-generate

uuid-generate #!optional METHODprocedure

Returns a new uuid made using the stated METHOD.

METHOD
(or false symbol) ; the UUID Version
'v1, 'V1, or 'time
DCE Version 1 (MAC address) algorithm.
'v4, 'V4, or 'random
DCE Version 4 (random) algorithm.
#f
DCE V4 if a high-quality random device available, otherwise DCE V1. The default.

An invalid METHOD is an error condition.

uuid-clear!

uuid-clear! UUIDprocedure

Returns the UUID set to the null-uuid.

uuid-copy

uuid-copy UUIDprocedure

Returns a copy of the UUID.

string->uuid

string->uuid UUID-STRINGprocedure

Returns a new uuid from the external string representation UUID-STRING.

uuid->string

uuid->string UUIDprocedure

Returns the external string representation of UUID.

uuid-parse

uuid-parse UUID-TEXTprocedure

Returns a new uuid from the external string representation UUID-TEXT.

uuid-unparse

uuid-unparse UUID #!optional CASEprocedure

Returns the external string representation of UUID.

CASE
(or false symbol) ; 'upper, 'lower, or #f. Default is #f.

An invalid CASE is an error condition.

Predicates

uuid?

uuid? UUIDprocedure

Is UUID a uuid?

uuid-null?

uuid-null? UUIDprocedure

Is UUID the null uuid?

uuid-compare

uuid-compare UUID1 UUID2procedure

Returns -1, 0. or 1 for the comparison of UUID1 and UUID2.

uuid=?

uuid<?

uuid>?

uuid<=?

uuid>=?

uuid=? UUID1 UUID2procedure
uuid<? UUID1 UUID2procedure
uuid>? UUID1 UUID2procedure
uuid<=? UUID1 UUID2procedure
uuid>=? UUID1 UUID2procedure

uuid-compare wrappers.

uuid-hash

uuid-hash UUID #!optional BOUND RANDOMIZATIONprocedure

Returns a hash of the UUID, modulo the BOUND, & the RANDOMIZATION.

A srfi-69 compatible, version specific, hash function.

Version & Method

uuid-version : {{(or false fixnum)
uuid-method : {{(or false symbol)

uuid-version?

uuid-version? OBJprocedure

Is the OBJ a uuid-version?

uuid-version->method

uuid-version->method VERSIONprocedure

An invalid VERSION is an error condition.

uuid-method->version

uuid-method->version METHODprocedure

An invalid METHOD is an error condition.

uuid-method

uuid-method UUIDprocedure

uuid-version-number

uuid-version-number UUIDprocedure

Returns UUID version-number, 0 .. 15.

Note that uuid-version-number is not reliable cross-platform; 'linux' for example.

check-uuid

uuid-print UUID #!optional PORTprocedure

Checks & Errors

check-uuid

error-uuid

check-uuid LOC OBJ #!optional ARGNAMprocedure
error-uuid LOC OBJ #!optional ARGNAMprocedure

check-uuid-version

error-uuid-version

check-uuid-version LOC OBJ #!optional ARGNAMprocedure
error-uuid-version LOC * #!optional ARGNAMprocedure

Usage

(import uuid-lib)

Notes

Requirements

record-variants

test test-utils

Author

Kon Lovett

Version history

0.0.8
Add uuid-version-number.
0.0.6
.
0.0.6
variant => method.
0.0.5
Fix uuid-parse uuid method.
0.0.4
(srfi 69) compatible hashers.
0.0.3
Add uuid-hash uuid-v4-hash, & uuid-print. Add record printer.
0.0.2
.
0.0.1
C5 port of C4 1.5.0 (need Linux testing).

License

Copyright (C) 2010-2023 Kon Lovett. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contents »