{"size": 2819, "ext": "scrbl", "max_stars_repo_path": "doc/utils/rfc/uuid.scrbl", "max_stars_repo_name": "david135/sagittarius-scheme", "max_stars_repo_stars_event_min_datetime": "2015-11-07T07:13:35.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-15T03:35:14.000Z", "max_issues_repo_path": "doc/utils/rfc/uuid.scrbl", "max_issues_repo_name": "david135/sagittarius-scheme", "max_issues_repo_issues_event_min_datetime": "2016-04-28T21:59:59.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-01T08:42:21.000Z", "max_forks_repo_path": "doc/utils/rfc/uuid.scrbl", "max_forks_repo_name": "david135/sagittarius-scheme", "max_forks_repo_forks_event_min_datetime": "2016-12-28T12:41:23.000Z", "max_forks_repo_forks_event_max_datetime": "2020-02-26T20:52:02.000Z"}
{"max_stars_count": 39, "max_issues_count": 3, "max_forks_count": 4, "avg_line_length": 31.3222222222, "max_line_length": 88, "alphanum_fraction": 0.7296913799}
@; -*- coding: utf-8 -*-
@subsection[:tag "rfc.uuid"]{(rfc uuid) - UUID generate library}

@define[Library]{@name{(rfc uuid)}}
@desc{This library provides RFC 4122 a Universally Unique IDentifier (UUID)
URN Namespace procedures.}


@define[Class]{@name{<uuid>}}
@desc{The class representing UUID.}

@subsubsection{Predicates}

@define[Function]{@name{uuid?} @args{obj}}
@desc{Returns #t if the @var{obj} is an instance of @code{<uuid>}, otherwise
 #f.}

@define[Function]{@name{uuid=?} @args{uuid1 uuid2}}
@desc{Compares given 2 uuids and return #t if both have the same values,
otherwise #f.}

@subsubsection{Constructors}

@define[Function]{@name{make-null-uuid}}
@desc{Creates a null (empty) uuid.

The returning object will be represented like this UUID;

@code{00000000-0000-0000-0000-000000000000}.
}

@define[Function]{@name{make-v1-uuid}}
@define[Function]{@name{make-v3-uuid} @args{namespace name}}
@define[Function]{@name{make-v4-uuid} @args{:optional prng}}
@define[Function]{@name{make-v5-uuid} @args{namespace name}}
@desc{Creates version 1, 3, 4 and 5 UUIDs respectively.

For version 3 and 5, procedures need to take 2 arguments, @var{namespace}
and @var{name}. @var{namespace} must be a UUID object, and @var{name} must be a
string.

For version 4, it can take an optional argument @var{prng} which specifies
pseudo random generator. The default value is @code{(*uuid-random-state*)}.
}

@subsubsection{Predefined namespaces and parameters}

@define[Constant]{@name{+namespace-dns+}}
@define[Constant]{@name{+namespace-url+}}
@define[Constant]{@name{+namespace-oid+}}
@define[Constant]{@name{+namespace-x500+}}
@desc{Constant predefined namespace of UUIDs.}

@define[Variable]{@name{*uuid-random-state*}}
@desc{Pseudo random generator used by version 4 UUID.}

@define[Variable]{@name{*uuids-per-tick*}}
@desc{The number of allowed UUIDs in the same time. Used by version 1 UUID.

The default value is 1000.
}

@subsubsection{Converters}

@define[Function]{@name{uuid->bytevector} @args{uuid}}
@desc{Returns bytevector converted from given @var{uuid}.

@snipet[=> "#vu8(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)"]{(uuid->bytevector (make-null-uuid))}
}

@define[Function]{@name{uuid->string} @args{uuid}}
@desc{Returns string represented uuid converted from given @var{uuid}.

@snipet[=> "00000000-0000-0000-0000-000000000000"]{(uuid->string (make-null-uuid))}
}

@define[Function]{@name{bytevector->uuid} @args{bv}}
@desc{Returns uuid object generated from @var{bv}.

Given bytevector must have length at least 16.
}

@define[Function]{@name{string->uuid} @args{string}}
@desc{Returns uuid object generated from @var{string}.

Given @var{string} must be proper format of UUID defined in RFC 4122.}

@define[Function]{@name{uuid->urn-format} @args{uuid}}
@desc{Returns URN formatted string of given @var{uuid}.
}