add readme and license
This commit is contained in:
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -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.
|
||||||
26
README.md
Normal file
26
README.md
Normal file
@@ -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.
|
||||||
Reference in New Issue
Block a user