The cl-ksuid Reference Manual

Table of Contents

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 2.3 "Robert April" on Wed Mar 14 03:22:46 2018 GMT+0.


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

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.


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

2 Systems

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


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

2.1 cl-ksuid

Author

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

License

GPLv3

Description

K-sortable unique identifiers

Version

1.0.0

Dependencies
Source

cl-ksuid.asd (file)

Components

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

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 files   [Contents][Index]

3.1.1 cl-ksuid.asd

Location

cl-ksuid.asd

Systems

cl-ksuid (system)


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

3.1.2 cl-ksuid/package.lisp

Parent

cl-ksuid (system)

Location

package.lisp

Packages

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

3.1.3 cl-ksuid/cl-ksuid.lisp

Dependency

package.lisp (file)

Parent

cl-ksuid (system)

Location

cl-ksuid.lisp

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 cl-ksuid-test

Source

package.lisp (file)

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 (file)

Nickname

ksuid

Use List

common-lisp

Used By List

cl-ksuid-test

Exported Definitions
Internal Definitions

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

5 Definitions

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


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

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: ksuid-equal X Y

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

Package

cl-ksuid

Source

cl-ksuid.lisp (file)

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 (file)

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 (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Generic functions

Generic Function: bytes OBJECT
Package

cl-ksuid

Methods
Method: bytes (KSUID ksuid)

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

Source

cl-ksuid.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 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 (file)

Direct superclasses

standard-object (class)

Direct methods
  • print-object (method)
  • initialize-instance (method)
  • bytes (method)
Direct slots
Slot: bytes

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

Type

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

Initargs

:bytes

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))

Readers

bytes (generic function)


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

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: +base62-characters*
Package

cl-ksuid

Source

cl-ksuid.lisp (file)

Constant: +epoch+
Package

cl-ksuid

Source

cl-ksuid.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Macros

Macro: define-constant NAME VALUE &optional DOC
Package

cl-ksuid

Source

cl-ksuid.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: base-to-base OCTETS IN-BASE OUT-BASE
Package

cl-ksuid

Source

cl-ksuid.lisp (file)

Function: decode STRING
Package

cl-ksuid

Source

cl-ksuid.lisp (file)

Function: encode OCTETS
Package

cl-ksuid

Source

cl-ksuid.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-ksuid.asd: The cl-ksuid<dot>asd file
cl-ksuid/cl-ksuid.lisp: The cl-ksuid/cl-ksuid<dot>lisp file
cl-ksuid/package.lisp: The cl-ksuid/package<dot>lisp file

F
File, Lisp, cl-ksuid.asd: The cl-ksuid<dot>asd file
File, Lisp, cl-ksuid/cl-ksuid.lisp: The cl-ksuid/cl-ksuid<dot>lisp file
File, Lisp, cl-ksuid/package.lisp: The cl-ksuid/package<dot>lisp file

L
Lisp File, cl-ksuid.asd: The cl-ksuid<dot>asd file
Lisp File, cl-ksuid/cl-ksuid.lisp: The cl-ksuid/cl-ksuid<dot>lisp file
Lisp File, cl-ksuid/package.lisp: The cl-ksuid/package<dot>lisp file

Jump to:   C   F   L  

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

A.2 Functions

Jump to:   B   D   E   F   G   K   M   S  
Index Entry  Section

B
base-to-base: Internal functions
bytes: Exported generic functions
bytes: Exported generic functions

D
decode: Internal functions
define-constant: Internal macros

E
encode: Internal functions

F
Function, base-to-base: Internal functions
Function, decode: Internal functions
Function, encode: Internal functions
Function, ksuid-equal: Exported functions
Function, ksuid-universal-time: Exported functions
Function, string-to-ksuid: Exported functions

G
Generic Function, bytes: Exported generic functions

K
ksuid-equal: Exported functions
ksuid-universal-time: Exported functions

M
Macro, define-constant: Internal macros
Method, bytes: Exported generic functions

S
string-to-ksuid: Exported functions

Jump to:   B   D   E   F   G   K   M   S  

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

A.3 Variables

Jump to:   +  
B   C   S  
Index Entry  Section

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

B
bytes: Exported classes

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

S
Slot, bytes: Exported classes

Jump to:   +  
B   C   S  

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

A.4 Data types

Jump to:   C   K   P   S  
Index Entry  Section

C
cl-ksuid: The cl-ksuid system
cl-ksuid: The cl-ksuid package
cl-ksuid-test: The cl-ksuid-test package
Class, ksuid: Exported classes

K
ksuid: Exported classes

P
Package, cl-ksuid: The cl-ksuid package
Package, cl-ksuid-test: The cl-ksuid-test package

S
System, cl-ksuid: The cl-ksuid system

Jump to:   C   K   P   S