Every grain of sand on Earth has its own ID.
The algorithm used to generate the sandid.SandID
mainly come
from the UUID version 1. Some
adjustments were made to enhance the efficiency of
database insertion.
- 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
andencoding.TextUnmarshaler
- Implemented
encoding.BinaryMarshaler
andencoding.BinaryUnmarshaler
- Implemented
json.Marshaler
andjson.Unmarshaler
- Implemented
- SQL friendly
sandid.NullSandID
support- Implemented
sql.Scanner
anddriver.Valuer
- Zero third-party dependencies
To use this project programmatically, go get
it:
go get github.com/aofei/sandid
If you have any questions or ideas about this project, feel free to discuss them here.
If you would like to contribute to this project, please submit issues here or pull requests here.
When submitting a pull request, please make sure its commit messages adhere to Conventional Commits 1.0.0.
This project is licensed under the MIT License.