Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 0.7% on proxy.golang.org
Top 0.1% dependent packages on proxy.golang.org
Top 0.1% dependent repos on proxy.golang.org
Top 2.0% forks on proxy.golang.org
Top 0.1% docker downloads on proxy.golang.org

proxy.golang.org : github.com/rs/xid

Package xid is a globally unique id generator suited for web scale Xid is using Mongo Object ID algorithm to generate globally unique ids: https://docs.mongodb.org/manual/reference/object-id/ The binary representation of the id is compatible with Mongo 12 bytes Object IDs. The string representation is using base32 hex (w/o padding) for better space efficiency when stored in that form (20 bytes). The hex variant of base32 is used to retain the sortable property of the id. Xid doesn't use base64 because case sensitivity and the 2 non alphanum chars may be an issue when transported as a string between various systems. Base36 wasn't retained either because 1/ it's not standard 2/ the resulting size is not predictable (not bit aligned) and 3/ it would not remain sortable. To validate a base32 `xid`, expect a 20 chars long, all lowercase sequence of `a` to `v` letters and `0` to `9` numbers (`[0-9a-v]{20}`). UUID is 16 bytes (128 bits), snowflake is 8 bytes (64 bits), xid stands in between with 12 bytes with a more compact string representation ready for the web and no required configuration or central generation server. Features: Best used with xlog's RequestIDHandler (https://godoc.org/github.com/rs/xlog#RequestIDHandler). References:

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/rs/xid
License: MIT
Latest release: about 1 year ago
First release: about 6 years ago
Namespace: github.com/rs
Dependent packages: 4,749
Dependent repositories: 35,925
Stars: 3,257 on GitHub
Forks: 188 on GitHub
Docker dependents: 2,924
Docker downloads: 13,160,154,012
See more repository details: repos.ecosyste.ms
Last synced: 5 days ago

    Loading...
    Readme
    Loading...