4 ms·
ULID's presentation format is probably better for humans, though. You can double-click-to-highlight a ULID; the standard UUID representation doesn't like this.
by eropple 2y ago
ULID's presentation format is probably better for humans, though. You can double-click-to-highlight a ULID; the standard UUID representation doesn't like this.
(You can use ULID's presentational tools with UUIDv7, though.)
- wtetzner 2y ago> the standard UUID representation doesn't like this. Yeah, I've gotten in the habit of stripping hyphens from the string representation of UUIDs in a lot of the code I write for that reason.
- beart 2y agoIt doesn't help in other tools, but there is a css rule to help with this. https://developer.mozilla.org/en-US/docs/Web/CSS/user-select https://developer.mozilla.org/en-US/docs/Web/CSS/user-select
- Lammy 2y ago> You can double-click-to-highlight a ULID; the standard UUID representation doesn't like this. You can control this behavior in CSS with `user-select`. Peep my fiddle: https://jsfiddle.net/gLyph5km/ https://jsfiddle.net/gLyph5km/
- eropple 2y agoYup, in a browser you can. In my terminal or my text editor or Slack, I can't.
- Lammy 2y agoYou're right that there isn't a good standard way to configure this, but a lot of terminals should be able to do it. The magic phrase is “word characters”. I know Konsole, gnome-terminal, iTerm2, Terminal-dot-app at least have this setting.
- eropple 2y agoYep, I know about that (and WORDCHARS in zsh, for keyboard navigation). The thing is, though, UUIDs overload the dash character. I don't want dashes to be word characters except for a UUID. (ULID representations also are shorter because they use a wider character set, which is nice though not critical.)
- NetOpWibby 2y agoYeah I’m sticking with ULID and Sqids for my ID/slug purposes.
- notpushkin 2y ago> You can use ULID's presentational tools with UUIDv7, though. I did that, works pretty good: https://codeberg.org/prettyid/python https://codeberg.org/prettyid/python Some more context in a sibling thread: https://news.ycombinator.com/item?id=41355218 https://news.ycombinator.com/item?id=41355218