The cl-ksuid Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-ksuid Reference Manual

This is the cl-ksuid Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 03:53:32 2022 GMT+0.

Table of Contents


1 Introduction

cl-ksuid

cl-ksuid implements KSUIDs in Common Lisp. KSUIDs are short (20 byte or 27 base62 character) unique IDs composed of a 32-bit timestamp followed by 128 bits of randomness. Due to the timestamp, they are sortable by creation second. They are described further in A Brief History of the UUID.

E.g. 0puTTYvbQvWBglQicRUWdOdKnt9 or 0pw8wwIBsPD8yLcQS9rBSlIFet0.

KSUIDs may be created with (make-instance 'ksuid); they can be printed to a character stream so long as *print-readably* is nil; their bytes may be extracted with the BYTES reader. Finally, a string may be parsed as a KSUID with STRING-TO-KSUID.


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-ksuid

K-sortable unique identifiers

Author

Bob Uhl <bob.denver.co@gmail.com>

License

GPLv3

Version

1.0.0

Dependencies
  • babel (system).
  • ironclad (system).
Source

cl-ksuid.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 cl-ksuid/cl-ksuid.asd

Source

cl-ksuid.asd.

Parent Component

cl-ksuid (system).

ASDF Systems

cl-ksuid.


3.1.2 cl-ksuid/package.lisp

Source

cl-ksuid.asd.

Parent Component

cl-ksuid (system).

Packages

Previous: , Up: Lisp   [Contents][Index]

3.1.3 cl-ksuid/cl-ksuid.lisp

Dependency

package.lisp (file).

Source

cl-ksuid.asd.

Parent Component

cl-ksuid (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 cl-ksuid-test

Source

package.lisp.

Use List

Previous: , Up: Packages   [Contents][Index]

4.2 cl-ksuid

CL-KSUID provides K-sorted unique identifiers as described in <URL:https://segment.com/blog/a-brief-history-of-the-uuid/> and implemented in <URL:https://github.com/segmentio/ksuid>; any incompatibility should be treated as a bug.

Source

package.lisp.

Nickname

ksuid

Use List

common-lisp.

Used By List

cl-ksuid-test.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Ordinary functions

Function: ksuid-equal (x y)

KSUID-EQUAL returns NIL unless X & Y are equivalent KSUIDs.

Package

cl-ksuid.

Source

cl-ksuid.lisp.

Function: ksuid-universal-time (ksuid)

KSUID-UNIVERSAL-TIME returns the timestamp component of KSUID as a universal time.

Package

cl-ksuid.

Source

cl-ksuid.lisp.

Function: string-to-ksuid (string)

STRING-TO-KSUID parses STRING into a KSUID. It signals a PARSE-ERROR error condition if STRING is an invalid KSUID.

Package

cl-ksuid.

Source

cl-ksuid.lisp.


5.1.2 Generic functions

Generic Reader: bytes (object)
Package

cl-ksuid.

Methods
Reader Method: bytes ((ksuid ksuid))

Client code should use the BYTES accessor, not access the slot directly.

Source

cl-ksuid.lisp.

Target Slot

bytes.


5.1.3 Standalone methods

Method: initialize-instance :after ((ksuid ksuid) &rest initargs &key &allow-other-keys)
Source

cl-ksuid.lisp.

Method: print-object ((ksuid ksuid) stream)

PRINT-OBJECT prints a KSUID to STREAM. It will signal a PRINT-NOT-READABLE error condition if *PRINT-READABLY* is non-nil.

Source

cl-ksuid.lisp.


5.1.4 Classes

Class: ksuid

KSUID represents a KSUID. Client code should use BYTES and PRINT-OBJECT to access the KSUID in raw & string form.

Package

cl-ksuid.

Source

cl-ksuid.lisp.

Direct methods
Direct slots
Slot: bytes

Client code should use the BYTES accessor, not access the slot directly.

Type

(quote (vector (unsigned-byte 8)))

Initform

(concatenate (quote (vector (unsigned-byte 8))) (ironclad:integer-to-octets (- (get-universal-time) cl-ksuid::+epoch+) :n-bits 32 :big-endian t) (ironclad:random-data 16))

Initargs

:bytes

Readers

bytes.

Writers

This slot is read-only.


5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Constants

Constant: +base62-characters*
Package

cl-ksuid.

Source

cl-ksuid.lisp.

Constant: +epoch+
Package

cl-ksuid.

Source

cl-ksuid.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.2 Macros

Macro: define-constant (name value &optional doc)
Package

cl-ksuid.

Source

cl-ksuid.lisp.


Previous: , Up: Internals   [Contents][Index]

5.2.3 Ordinary functions

Function: base-to-base (octets in-base out-base)
Package

cl-ksuid.

Source

cl-ksuid.lisp.

Function: decode (string)
Package

cl-ksuid.

Source

cl-ksuid.lisp.

Function: encode (octets)
Package

cl-ksuid.

Source

cl-ksuid.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
B   C   S  
Index Entry  Section

+
+base62-characters*: Private constants
+epoch+: Private constants

B
bytes: Public classes

C
Constant, +base62-characters*: Private constants
Constant, +epoch+: Private constants

S
Slot, bytes: Public classes

Jump to:   +  
B   C   S