Comments (2)
This is just an implementation of the ULID Spec.
01AN4Z07BY 79KA1307SR9X4MV3
|----------| |----------------|
Timestamp Randomness
48bits 80bits
A ULID
is a 128bit datatype. 128bits of 1 expressed via Crockford happens to be 7ZZZZZZZZZZZZZZZZZZZZZZZZZ
. Therefore bigger numbers encoded in Crockford won't fit into the 128bit of the data type. Trying to parse them is an error.
There are 48 bits reserved for timestamp which is defined to contain ms of Unix time. Those 48 bits will overflow precisely 1ms after +10889-08-02T05:31:50.655Z
- and since that would break lexicographical sorting (the whole point of ULID vs. just random bits) it is considered an error.
Hope that helps.
from sulky.
Thank you very much for your explanation! In the process of analysis, I ignored the key points of high order sorting and binary overflow.
from sulky.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sulky.