{"repo":"modfin/pg-xid","free":true,"listed":false,"github":"https://github.com/modfin/pg-xid","clone":"git clone https://github.com/modfin/pg-xid.git","description":"pg-xid is a globally unique id generator for postgres","language":"Go","stars":110,"topics":["guid","postgresql","postgres","xid"],"license":"MIT","category":"databases-storage","readme_excerpt":"XID for Postgres, Globally Unique ID Generator This project is a Postgres implementation of the Go Lang library found here: https://github.com/rs/xid --- Description Xid is a globally unique id generator functions. They are small and ordered. Xid uses the Mongo Object ID algorithm to generate globally unique ids with a different serialization (base32) to make it shorter when transported as a string: https://docs.mongodb.org/manual/reference/object-id/ Xid layout 0 1 2 3 4 5 6 7 8 9 10 11 time machine id pid counter - 4-byte value representing the seconds since the Unix epoch, - 3-byte machine identifier, - 2-byte process id, and - 3-byte counter, starting with a random value. 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 s simply offer uniqueness and speed, but they are not cryptographically secure. They are predictable and can be brute forced given enough time. Features - Size: 12 bytes (96 bits), smaller than UUID, larger than Twitter Snowflake - Base32 hex encoded by default (20 chars when transported as printable string, still sortable) - Configuration free: there is no need to set a unique machine and/or data center id - K-ordered - Embedded time with 1 second precision - Unicity guaranteed for 16,777,216 (24 bits) unique ids per sec","default_branch":null,"files":null,"tree":[],"storefront":"/r/modfin","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/modfin/pg-xid/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}