git-prime

Ensure your 160-bit git commit hashes are Number Theoretic compliant.

[PRIME CERTIFIED]

What is this?

A tool that fuzzes your commit messages until the resulting SHA-1 hash is a prime number when interpreted as a 160-bit integer.

Because your commits deserve mathematical rigor.

Installation

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

Windows (PowerShell): irm https://textonly.github.io/git-prime/install.ps1 | iex

Usage

$ git prime-commit "Fix critical bug"

Finds any prime hash.

Searching for prime commit hash...
Base message: Fix critical bug
Attempt 10: d051b974ece9d844... not prime
Attempt 20: 954de912a9e5bbce... not prime
Attempt 30: ace4df509c5a9677... not prime
...
Attempt 160: cb80ebbd975f0028... not prime

[PRIME] Found after 168 attempts!
  Commit: cb80ebbd975f00288dca70d8fa735c688755f947
  Hash as decimal: 1161800157764419353674868058637793188631547345223
  → Verify on WolframAlpha
  Message: "Fix critical bug"
Git-Prime-Nonce: 167
$ git prime-commit "Vanity Commit" --hex-prefix dead

Finds a prime hash starting with "dead..."
$ git prime-commit "Proof of Work" --difficulty 4

Finds a prime hash starting with "0000..." (proof-of-work style vanity)
$ git prime-log

[PRIME] cb80ebbd - Fix critical bug
a1b2c3d4 - Regular commit
[PRIME] 7e9f1a2b - Initial commit

How it works

Features

Why?

Mathematical Rigor: SHA-1 hashes are 160-bit integers. The Prime Number Theorem dictates that primes are abundant (~1 in 111 hashes), yet standard git commits rely on randomness, ignoring the elegance of indivisibility.

Indivisibility: A composite number can be broken down. It is weak. A prime number stands alone. By forcing your commit hash to be prime, you are ensuring that your code changes correspond to an atomic, unbreakable coordinate in the number line.

Because you can: The global distributed compute grid is mostly wasted on idle loops. git-prime reclaims those cycles to search for beautiful numbers.

Security Note: Does this increase collision risk?
Technically, yes. Practically, no.

Restricting hashes to prime numbers reduces the search space by a factor of ~111. In information theoretic terms, this reduces the entropy by approximately 7 bits (from 160 to ~153). While we don't recommend this for securing nuclear launch codes (mostly because it uses SHA-1), the probability of an accidental collision remains statistically zero.

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

Every developer running git prime-commit contributes cycles to the noble pursuit of finding 160-bit primes hidden in SHA-1 space. It's distributed computing for mathematically pointless but aesthetically satisfying goals.