frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

AlphaDec: A human-readable alternative to ULID/Snowflake IDs

https://github.com/firasd/alphadec
40•firasd•3d ago

Comments

firasd•3d ago
Hi folks, my project:

AlphaDec is a human-readable, lexically sortable UTC encoding. It's designed to be timezone-agnostic, reversible, and safe for use in LLMs, filenames, and database keys.

Examples like 2025_M4O2_todo.txt carry timing information (seasonal + positional) but avoid ISO collisions.

It encodes the full UTC year as a symmetrical orbital structure: 26 periods × 10 arcs × 26 bars × 10 beats. Each one tickable in JS, Bash, or Python.

Inspired by the clean abstractions of Snowflake IDs, but readable by humans and AIs.

Live clock: https://firasd.github.io/alphadec/

Interesting images of Claude reverse-engineering it:

1. https://firasd.github.io/alphadec/assets/2025_O3U4_alphadec_...

2. https://firasd.github.io/alphadec/assets/2025_O3U4_alphadec_...

3. https://firasd.github.io/alphadec/assets/2025_O3U4_alphadec_...

4. https://firasd.github.io/alphadec/assets/2025_O3U4_alphadec_...

JimDabell•6h ago
I’m a bit confused about the comparison with ULID.

Identifiers like that (and KSUID, etc.) have a time component and a random component, so that multiple systems that generate IDs simultaneously won’t collide.

This scheme only includes the time component. But in your comparison with ULID you describe it as collision resistant. How is this the case?

rfoo•2d ago
The project states that:

> LLM & AI-Native: Its structured, tokenizable nature makes it powerful primitive for time-based reasoning, prompt engineering, and log analysis in AI systems.

Being significantly OOD usually does not help in this case, did I miss something here?

firasd•2d ago
The OOD thing ironically helps a bit because sometimes AI can skim over regular timestamps and say two different times are the same etc. LLMs don't actually parse and calculate the timestamps after all. With AlphaDec it's very clear that two timestamps are different

Also I use a little preamble... here is what I send Anthropic's Claude Sonnet when it asks for the current AlphaDec over an MCP tool

// AlphaDec units (approx): Period = UTC yr (different length leap yr vs common yr) / 26 ≈ 14.04 days | Arc ≈ Period / 10 ≈ 33.7 hours | Bar ≈ Arc / 26 ≈ 77.75 minutes | Beat ≈ Bar / 10 ≈ 7.78 minutes. The final part of canonical AlphaDec is milliseconds offset within the beat. Period F, Period M, Period S, and Period Z always contain equinoxes/solstices. Truncating significant digits creates natural time groupings, eg 2025_M2 contains 'every alphadec in this arc' [ { "timezone": "UTC", "iso": "2025-07-25T00:47:09.219Z" }, { "timezone": "AlphaDec", "alphadec": "2025_O6B3_087680", "readable": "O6:B3" } ]

burnt-resistor•2d ago
And always, the big asterisk on using UTC instead of TAI: https://cr.yp.to/proto/utctai.html
akdor1154•6h ago
Entered with scepticism but left convinced. Looks very thoughtfully designed, nice!

I admit i do feel a bit uneasy about the rational numbers used in the definition, but i guess it doesn't matter for the purposes of this? And you do seem to have considered it. I still wonder if a less neat but integer-second or -millisecond definition might be useful, as round tripping could then be well defined i think? (If, as another poster hinted, you consider the interaction with leap seconds too)

andoando•4h ago
Hmm

ISO 8601: 2025-06-14T23:37:42.814Z

is far more readable than

alphadec: 202025_L0V3_001827

no?

throwaway290•52m ago
These days readable means readable by LLMs. Who has time to read anymore? There's too much content being generated llms every microsecond
satisfice•3h ago
Anything is human-readable, if you think this is. This is more human-readable than a QR code, I guess, but that isn’t saying much.
Dylan16807•3h ago
> ISO 8601 - Not sort-friendly as a string (unless zero-padded)

The zero padding is in fact part of the format.

> ISO 8601 - Verbose

It's an extra few characters but I can also tell what date it is and what time of day it is by looking at it.

Also you can remove the separators to make it only 4 characters longer.

On the other hand if you really want it to be compact, AlphaDec doesn't do the job. To go from year down to second you need 8 characters, and then 3 more for milliseconds. Base32 would need 5 and then 2 more.

There's probably a good middle ground here but I think AlphaDec sacrifices too much. I'd much rather have something that encodes month, day, and hour into one character each so even if I didn't memorize which is which I can at least truncate by them instead of periods, arcs, and bars.

I think the pure 4-character version has some good appeal, but both truncating it and extending it for better precision lose most of that appeal.

> ISO 8601 - Not great for filenames or embeddings

I guess, but using a different character from colon is a very simple tweak you can make.

gregman1•2h ago
Cannot agree more! AlphaDec is a great example of why we should consult existing standards before spending so much time and resources to develop something inferior.
nivertech•2h ago

  AlphaDec: 2025_L0V3_001827
  
  Instead of:
  
  ISO 8601: 2025-06-14T23:37:42.814Z
This is misleading. The precision is less than 1 min, So it should be:

  AlphaDec: 2025_L0V3_001827
  
  Instead of:
  
  ISO 8601: 2025-06-14T23:37
  
  or

  DateTime: 20250614_2337
This format is a Rube Goldberg machine which adds nothing to the table.

BTW: was this format designed with the help of an LLM? LLMs can easily misunderstand or miss the big picture, while over-optimizing for small details.

nine_k•1h ago
A decimal digit encodes approximately 3.3 bits. The current Unix timestamp (barely) fits into 32 bits, so it should take approximately 10 decimal digits to represent. The number of seconds since the beginning 0 CE fits into 36 bits, so requires 12 decimal digits at least. The ISO timestamp (YYYY-mm-dd HH:MM:SS) requires 4 + 4 + 6 = 14 decimal digits.

If we wanted to compress the representation while remaining within ASCII and allowing for textual sorting and easy glancing, our best bet is something like base64: Latin upper case + lower case + digits give us 66 characters, a soupçon more than 6 bits per character. We'd need only 6 characters to represent a 36-bit timestamp with 1 second precision, and just 5, for a minute precision. Yay!

Better yet, since timekeeping is base 60 since Sumerian times, we could directly represent minutes and seconds with one digit each, using base60 (with a room to spare for the leap second). Relinquishing 1.5 more bits, we could use only 24 distinct values for hours, allowing for a clear separation of "date" and "time"; time would take 3 characters, like D7a.

If we agree to spend 2 characters (12 bit) for month + day, then the month and the day directly map to one character each. Now allocate 2 characters for the year, and we're set until year 4095, when we could reconsider.

So, we have a timestamp of 2 + 2 + 3 = 7 characters, only one longer than the theoretical minimum, and with quite a room to spare. The result directly maps to the traditional calendar dates, with year, month, day, hour, minute, second being separate digits, and which is readable, sortable, pronounceable, and trimmable. (Now we only need to write it in cuneiform again.)

Enough AI copilots, we need AI HUDs

https://www.geoffreylitt.com/2025/07/27/enough-ai-copilots-we-need-ai-huds
365•walterbell•9h ago•112 comments

Big agriculture mislead the public about the benefits of biofuels

https://lithub.com/how-big-agriculture-mislead-the-public-about-the-benefits-of-biofuels/
108•littlexsparkee•6h ago•76 comments

Performance and telemetry analysis of Trae IDE, ByteDance's VSCode fork

https://github.com/segmentationf4u1t/trae_telemetry_research
818•segfault22•13h ago•296 comments

Dumb Pipe

https://www.dumbpipe.dev/
706•udev4096•17h ago•164 comments

SIMD Within a Register: How I Doubled Hash Table Lookup Performance

https://maltsev.space/blog/012-simd-within-a-register-how-i-doubled-hash-table-lookup-performance
19•axeluser•2h ago•0 comments

Blender: Beyond Mouse and Keyboard

https://code.blender.org/2025/07/beyond-mouse-keyboard/
135•dagmx•3d ago•40 comments

How I fixed my blog's performance issues by writing a new Jekyll plugin

https://arclight.run/how-i-fixed-my-blogs-performance-issues-by-writing-a-new-jekyll-plugin-jekyll-skyhook/
20•arclight_•3d ago•5 comments

Multiplex: Command-Line Process Mutliplexer

https://github.com/sebastien/multiplex
13•todsacerdoti•2h ago•1 comments

I hacked my washing machine

https://nexy.blog/2025/07/27/how-i-hacked-my-washing-machine/
212•JadedBlueEyes•11h ago•94 comments

Software Development at 800 Words per Minute

https://neurrone.com/posts/software-development-at-800-wpm/
51•ClawsOnPaws•3d ago•12 comments

Making Postgres slower

https://byteofdev.com/posts/making-postgres-slow/
244•AsyncBanana•10h ago•24 comments

EU age verification app to ban any Android system not licensed by Google

https://www.reddit.com/r/degoogle/s/YxmPgFes8a
610•cft•9h ago•307 comments

Claude Code Router

https://github.com/musistudio/claude-code-router
63•y1n0•7h ago•10 comments

Formal specs as sets of behaviors

https://surfingcomplexity.blog/2025/07/26/formal-specs-as-sets-of-behaviors/
23•gm678•19h ago•3 comments

VPN use surges in UK as new online safety rules kick in

https://www.ft.com/content/356674b0-9f1d-4f95-b1d5-f27570379a9b
129•mmarian•5h ago•83 comments

ZUSE – The Modern IRC Chat for the Terminal Made in Go/Bubbletea

https://github.com/babycommando/zuse
56•babycommando•8h ago•28 comments

Solid protocol restores digital agency

https://www.schneier.com/blog/archives/2025/07/how-solid-protocol-restores-digital-agency.html
33•speckx•3d ago•17 comments

Ask HN: What are you working on? (July 2025)

170•david927•14h ago•508 comments

Why I write recursive descent parsers, despite their issues (2020)

https://utcc.utoronto.ca/~cks/space/blog/programming/WhyRDParsersForMe
67•blobcode•4d ago•30 comments

The JJ VCS workshop: A zero-to-hero speedrun

https://github.com/jkoppel/jj-workshop
123•todsacerdoti•19h ago•12 comments

“Tivoization” and your right to install under Copyleft and GPL (2021)

https://sfconservancy.org/blog/2021/jul/23/tivoization-and-the-gpl-right-to-install/
43•pabs3•3h ago•1 comments

Digitising CDs (a.k.a. using your phone as an image scanner)

https://www.hadess.net/2025/07/digitising-cds-aka-using-your-phone-as.html
6•JNRowe•3h ago•0 comments

Fourble turns lists of MP3 files hosted anywhere into podcasts

https://fourble.co.uk/podcasts
5•42lux•3d ago•0 comments

IBM Keyboard Patents

https://sharktastica.co.uk/topics/patents
63•tart-lemonade•11h ago•4 comments

How big can I print my image?

https://maurycyz.com/misc/printing/
16•LorenDB•3d ago•4 comments

Designing a flatpack bed

https://kevinlynagh.com/newsletter/2025_07_flatpack/
42•todsacerdoti•9h ago•13 comments

Bits 0x02: switching to orion as a browser

https://andinfinity.eu/post/2025-07-24-bits-0x02/
48•fside•2d ago•9 comments

Tom Lehrer has died

https://www.nytimes.com/2025/07/27/arts/music/tom-lehrer-dead.html
535•detaro•14h ago•95 comments

Why does a fire truck cost $2m

https://thehustle.co/originals/why-does-a-fire-truck-cost-2-million
175•Guid_NewGuid•6h ago•181 comments

The many JavaScript runtimes of the last decade

https://buttondown.com/whatever_jamie/archive/the-many-many-many-javascript-runtimes-of-the-last-decade/
188•LinguaBrowse•17h ago•75 comments