Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aofei/sandid
Every grain of sand on Earth has its own ID.
https://github.com/aofei/sandid
generator go id sandid unique
Last synced: 3 months ago
JSON representation
Every grain of sand on Earth has its own ID.
- Host: GitHub
- URL: https://github.com/aofei/sandid
- Owner: aofei
- License: mit
- Created: 2018-06-12T01:24:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-04T09:10:51.000Z (over 2 years ago)
- Last Synced: 2024-07-31T20:52:32.091Z (5 months ago)
- Topics: generator, go, id, sandid, unique
- Language: Go
- Homepage: https://pkg.go.dev/github.com/aofei/sandid
- Size: 44.9 KB
- Stars: 45
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - sandid - Every grain of sand on earth has its own ID. (Miscellaneous / Uncategorized)
- zero-alloc-awesome-go - sandid - Every grain of sand on earth has its own ID. (Miscellaneous / Uncategorized)
- awesome-go - sandid - Every grain of sand on earth has its own ID. - ★ 3 (Miscellaneous)
- awesome-go-extra - sandid - 06-12T01:24:14Z|2022-08-04T09:10:51Z| (Microsoft Office / Uncategorized)
- awesome-go-zh - sandid
README
# SandID
[![GitHub Actions](https://github.com/aofei/sandid/workflows/Test/badge.svg)](https://github.com/aofei/sandid)
[![codecov](https://codecov.io/gh/aofei/sandid/branch/master/graph/badge.svg)](https://codecov.io/gh/aofei/sandid)
[![Go Report Card](https://goreportcard.com/badge/github.com/aofei/sandid)](https://goreportcard.com/report/github.com/aofei/sandid)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/aofei/sandid)](https://pkg.go.dev/github.com/aofei/sandid)Every grain of sand on Earth has its own ID.
**Note that the algorithm used to generate the
[`sandid.SandID`](https://pkg.go.dev/github.com/aofei/sandid#SandID) mainly come
from the [UUID](https://tools.ietf.org/html/rfc4122) version 1. Some adjustments
were made to enhance the efficiency of database insertion (see
[this](https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/)).**## Features
* Extremely easy to use
* Fixed length
* 16 bytes
* 22 characters
* 128-bit
* Huge capacity
* Up to 2e128
* URL safe
* `^[A-Za-z0-9-_]{22}$`
* Encoding friendly
* Implemented [`encoding.TextMarshaler`](https://pkg.go.dev/encoding#TextMarshaler) and [`encoding.TextUnmarshaler`](https://pkg.go.dev/encoding#TextUnmarshaler)
* Implemented [`encoding.BinaryMarshaler`](https://pkg.go.dev/encoding#BinaryMarshaler) and [`encoding.BinaryUnmarshaler`](https://pkg.go.dev/encoding#BinaryUnmarshaler)
* Implemented [`json.Marshaler`](https://pkg.go.dev/encoding/json#Marshaler) and [`json.Unmarshaler`](https://pkg.go.dev/encoding/json#Unmarshaler)
* SQL friendly
* [`sandid.NullSandID`](https://pkg.go.dev/github.com/aofei/sandid#NullSandID) support
* Implemented [`sql.Scanner`](https://pkg.go.dev/database/sql#Scanner) and [`driver.Valuer`](https://pkg.go.dev/database/sql/driver#Valuer)
* Zero third-party dependencies## Installation
Open your terminal and execute
```bash
$ go get github.com/aofei/sandid
```done.
> The only requirement is the [Go](https://go.dev), at least v1.13.
## Community
If you want to discuss SandID, or ask questions about it, simply post questions
or ideas [here](https://github.com/aofei/sandid/issues).## Contributing
If you want to help build SandID, simply follow
[this](https://github.com/aofei/sandid/wiki/Contributing) to send pull requests
[here](https://github.com/aofei/sandid/pulls).## License
This project is licensed under the MIT License.
License can be found [here](LICENSE).