Home

Awesome

uuidcheck

Go Reference Mentioned in Awesome Go Go Report Card Coverage Status License: MIT

A tiny, zero-dependency Go library that validates UUIDs against standard RFC 4122 formatting, converts UUIDv7() into timestamps by ensuring accuracy and light compute.

Why? Sometimes you just need to know if that string is a proper UUID without dragging in heavy libraries or writing clunky checks. uuidcheck does one thing and does it well.

Features

Getting Started

go get github.com/ashwingopalsamy/uuidcheck

How It Works

IsValidUUID runs a quick series of checks:

IsUUIDv7 checks the version nibble of the time_hi_and_version field, ensuring its '7'.

UUIDv7ToTimestamp extracts the first 48 bits from the UUID (the combination of time_low and part of time_mid) and interprets them as a Unix timestamp in milliseconds.

Examples

Valid:

Invalid:

Testing

We believe in solid test coverage. Just run:

go test -v ./...

You'll find unit tests and edge case scenarios in uuidcheck_test.go.

Contributing

Contributions are welcome! Feel free to open issues, submit PRs, or propose features. Just keep it simple and aligned with the library’s goal: blazing-fast, straightforward UUID validation.

License

This project is licensed under the MIT License.