https://github.com/miyako/uuid
UUID with Go
https://github.com/miyako/uuid
4d-class 4d-component
Last synced: about 2 months ago
JSON representation
UUID with Go
- Host: GitHub
- URL: https://github.com/miyako/uuid
- Owner: miyako
- License: mit
- Created: 2024-10-17T06:23:55.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-04T13:56:46.000Z (5 months ago)
- Last Synced: 2025-01-08T17:55:14.168Z (3 months ago)
- Topics: 4d-class, 4d-component
- Language: 4D
- Homepage: https://miyako.github.io/UUID/
- Size: 4.45 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](LICENSE)
# UUID
## dependencies.json
```json
{
"dependencies": {
"UUID": {
"github": "miyako/UUID",
"version": "*"
}
}
}
``````4d
var $UUID : cs.UUID.UUID
$UUID:=cs.UUID.UUID.new()$UUIDv7:=$UUID.v7()
$UUIDv6:=$UUID.v6()
$UUIDv5:=$UUID.v5("dns"; "www.4d.com") //ns:dns,url,oid,x500
$UUIDv4:=$UUID.v4()
$UUIDv3:=$UUID.v3("dns"; "www.4d.com") //ns:dns,url,oid,x500
$UUIDv1:=$UUID.v1()
```
the [CLI](https://github.com/miyako/go-uuid/blob/master/main.go) uses [gofrs/uuid](https://github.com/miyako/go-uuid).
## Go Build
```
GOOS=darwin GOARCH=arm64 go build -o uuid-arm main.go
GOOS=darwin GOARCH=amd64 go build -o uuid-amd main.go
lipo -create uuid-arm uuid-amd -output uuid
GOOS=windows GOARCH=amd64 go build -o uuid.exe main.go
```## CLI
```
uuid -mode 7 //this is the default
uuid -mode 6
uuid -mode 5 -ns dns -name www.4d.com
uuid -mode 4
uuid -mode 3 -ns dns -name www.4d.com
uuid -mode 1
```