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 :)
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.)
[PRIME] Found after 168 attempts! Commit: cb80ebbd975f00288dca70d8fa735c688755f947
Why does it say not prime then prime?
- 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 WinThen 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