logoalt Hacker News

Show HN: 48-digit prime numbers every git commit

62 pointsby keepamovin01/01/202648 commentsview on HN

Comments

hotenlast Tuesday at 10:41 PM

Personally I'd append the Nonce as a git trailer, not to the message body.

And would keep the date constant rather than use the time of each attempt (such that the only thing that actually varies is the Nonce)

And just for more fun... Nonces should only be prime numbers. Probably won't run out :)

show 3 replies
rbongerslast Tuesday at 9:26 PM

Finally, a tool optimized for creating Git commit hash collisions

show 2 replies
kazinatoryesterday at 1:26 AM

> Hash as int

Should be "Hash as decimal". The hexadecimal hash is already the same integer.

> Message: "Fix critical bug" + git-prime Nonce: 167

In the actual code it looks like:

  Fix critical bug
  
  git-prime Nonce: 167
So it is like a trailer. However, can trailer names have spaces in them?

A more conservative choices for the trailer header seems wiser, like:

  Prime-nonce: N
would be a safer choice for the trailer. (The word "git" is not required; we know we are in Git.)

Another subtlety is that if the message already has trailers, then you don't need to separate that from them by a blank line

Git has a command for manipulating trailers; that could be used.

(I see the developer doesn't really believe in this because I don't see the nonces in the commit messages of the project itself.)

show 1 reply
mlylelast Tuesday at 9:09 PM

Attempt 168: cb80ebbd975f0028... not prime

[PRIME] Found after 168 attempts! Commit: cb80ebbd975f00288dca70d8fa735c688755f947

Why does it say not prime then prime?

show 3 replies
wimllast Tuesday at 9:07 PM

Nice. I think it would be even more æsthetically pointless if it fuzzed the commit date, message whitespace, etc instead of adding a blob...

show 1 reply
kazinatoryesterday at 1:44 AM

Whenever you amend a commit, the commit time stamp changes; that ought to be enough, so that the nonce is not required. However, I think it has only second precision, so if you stick to honest wall time, it means 100 attempts require 100 seconds.

haute_cuisinelast Tuesday at 11:45 PM

This is amazing. A true proof of work. Have you considered finding hashes with leading zeros or making sure each hash starts with 1337?

show 1 reply
adzmlast Tuesday at 9:08 PM

Finally

show 1 reply
keepamovin01/01/2026

Why? Fun. Now every commit is a certified 160-bit prime number.

- Miller-Rabin primality test (40 rounds, ~10^-24 false positive rate)

- Fuzzes commit messages with nonces until finding a prime hash

- Average ~368 attempts to find a prime (based on prime density at 2^160)

- Actual performance: 30-120 seconds depending on luck

The philosophy: shouldn't the global distributed compute grid be used to forward number theoretic random non-goals like primality?

Every developer running git-prime contributes cycles to finding 160-bit primes hidden in SHA-1 space. Corporate pointless, but math & aesthets satisfying.

Install:

  curl -fsSL https://textonly.github.io/git-prime/install.sh | bash
or

  irm textonly.github.io/git-prime/install.ps1 | iex 
on Win

Then just run

  git prime-commit -m "my frickin commit message, etc..."
Side note: disappointed that this Show's item ID is NOT prime. 46454369 = 13 × 3573413. Would've been perfect meta-content, ahah
show 3 replies
libeclipseyesterday at 12:54 AM

Why not just change the nonce instead of appending it and save some space

show 1 reply
dudeinjapanlast Tuesday at 10:07 PM

Claude, copy git-prime but make it git-hexspeak instead https://en.wikipedia.org/wiki/Hexspeak

show 3 replies
cornonthecobrayesterday at 11:38 AM

But if my git hashes are indivisible, how will people fork my repo? /s