You are looking at historical revision 39572 of this page. It may differ significantly from its current revision.

Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

UUID

A native Chicken Scheme implementation for UUID generation. Primary development maintained on Github.

Canonical Github Repo: http://github.com/dsosby/chicken-uuid

Authors

David Sosby

Requirements

Just Chicken

API

[procedure] (uuid-v4 #!optional [randfn random])

Generates a purely random UUID conforming to RFC 4122 4.4. Uniqueness is dependent on a good random function. The default uses (extras random) but can be overridden with any function conforming to the (extras random) signature.

Returns a string.

Examples

(use uuid)

;; Generate a UUID based on (extras random)
(define decent-uuid (uuid-v4))

;; Generate a UUID based on other random number generator
(define (worse-random n) 1)
(define worse-uuid (uuid-v4 worse-random))

;; Get a list of UUIDs
(use srfi-1)
(define uuids (list-tabulate 5 (lambda (_) (uuid-v4))))

License

BSD

Version History

Version Comments
0.1 Initial release with random UUID generation