From 4366d43c084fcc75c12d5616ef6b4b89daa7cc93 Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Fri, 21 Nov 2025 10:45:35 -0500 Subject: [PATCH] add readme and license --- LICENSE | 21 +++++++++++++++++++++ README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2aab235 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Branden J Brown + +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 "AS IS", 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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..6b703be --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# [proposal: crypto/rand: add UUIDv4 and UUIDv7](https://golang.org/issue/76319) + +This package is an implementation of the crypto/rand API amended as proposed by #76319. + +```go +// UUIDv4 generates a RFC 9562 Version 4 UUID +// using only random bytes in the format: +// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. +func UUIDv4() string + +// UUIDv7 generates a RFC 9562 Version 7 UUID +// using the current time and random bytes in the format: +// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. +func UUIDv7() string +``` + +The UUID functions forward to github.com/google/uuid. +The rest forward to crypto/rand. +Unless you are changing the value of rand.Reader, this package a drop-in replacement for crypto/rand. + +This is an ergonomics test. +Most other UUID packages define `[16]byte` types, but #76319 proposes to add functions that return only the string forms of UUIDs. +You can use this package to check whether the proposed API works (better?) for you. + +There are questions that have been raised about the proposed API, especially with regard to the clock component of v7 UUIDs. +This package does not address those.