Comments (2)
You get true because you're using the same timestamp to generate the two ULIDs, so the only difference between them two is the random part. If you want id2 to sort after id1 even if they have the same time component, then you need to use the same Monotonic source.
Check this example: https://go.dev/play/p/ZsxbUBqef_6
from ulid.
Thank you very very much!
from ulid.
Related Issues (20)
- Proposal: Convenience Comparison Methods to ULID type HOT 1
- Bad example in documentation
- runtime error: slice bounds out of range [:8192] with capacity 4096 HOT 1
- Change `.Time()` method on ULID to return time.Time, add `UnixMilli` for returning ms HOT 1
- Multiple conflicting command-line tools called ulid exist HOT 8
- strict parsing by default HOT 6
- Switch defaultEntropy to math/rand/v2 HOT 5
- Error Unmarshaling from sqlx queries HOT 21
- A code for SAFE use across concurrent goroutines? HOT 3
- Is this a safe way to use ulid concurrently with other libraries too? HOT 7
- Propose change/addition to README HOT 1
- Empty value availability HOT 4
- Generated ulids should be unambigious HOT 4
- How about a MakeFromTime(time.Time) convenience function? HOT 4
- big bug: ulid is alway not sortable HOT 8
- How to upgrade? HOT 2
- bench testing panic HOT 2
- Use init() instead of sync.Once to initiate default entropy
- Fix description of Make()
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 ulid.