Try it
Call the public server:
curl https://sandbox.lapius7.com/go-uuid/v4
Install
pnpm (recommended)
[!IMPORTANT] This package assumes pnpm. Installing with both npm and pnpm leaves two copies of the same command, so use only
pnpm add -g.
pnpm add -g @lapius/go-uuid
The package ships prebuilt binaries for Linux (x64, arm64), macOS (x64, arm64), and Windows (x64). You don't need Go. Node.js 18 or later is required. Run the same command to update.
From source
git clone https://github.com/Lapius7/go-uuid.git && cd go-uuid
go run main.go
Usage
Run go-uuid to start an HTTP server on port 7100.
go-uuid
From another terminal, choose the UUID version with the path.
curl http://localhost:7100/ # v7
curl http://localhost:7100/v4 # v4 (random)
curl "http://localhost:7100/v5?name=lapius7.com"
Each request is written to the log (method, path, query, remote address, user agent, and the generated UUID). An invalid parameter returns 400 Bad Request.
Endpoints
| Path | Version | Description |
|---|---|---|
/ | v7 | Default |
/v1 | v1 | Timestamp and MAC address based |
/v2 | v2 | DCE Security. Accepts ?domain=person|group|org (default person) and ?id=<uint32> (default: UID of the user running the server) |
/v3 | v3 | Name based (MD5). Accepts ?namespace=<UUID> (default: DNS namespace) and ?name=<string> (default example.com) |
/v4 | v4 | Random |
/v5 | v5 | Name based (SHA-1). Same parameters as /v3 |
/v6 | v6 | Time-ordered, sortable timestamp |
/v7 | v7 | Unix millisecond timestamp |
Dependencies
- github.com/google/uuid v1.6.0
License
MIT. See LICENSE.