alt.hn

3/28/2025 at 10:55:04 AM

Show HN: I made a C program to create a vanity SHA-1 hash for a text file

https://gist.github.com/o0101/77eb378b5076fe47c3336583330ac615

by keepamovin

3/28/2025 at 11:00:20 AM

After experimenting with cycling punctuation, and random capitalization I hit on the idea to use each word as a bit and map the original version of the word to 0 and the title-case-toggled version of the word to 1.

Then just use the text file as a "counter nonce" and count from 0 until we find a counter that hashes to the vanity prefix we want.

The advantage of this is flipping the capitalization of the first letter of each word doesn't drastically alter the visual appearance of the file (tho it may alter semantics!), and you get an easy to understand amount of entropy (number of states) to walk through.

The C version linked only supports counting up to ~4 billion but it could be easily extended. A JS version using BigInt can go unlimited.

For reference the included example text took a surprising 2 billion iterations to discover the correct 8 digit hash which is about what you'd expect from random (i.e., half the state space of 16*8 = (2*4)*8)

by keepamovin

3/31/2025 at 5:25:35 PM

Don't bother applying here if your github doesn't look like this:

  $ git log --oneline
  deadbeef5 (HEAD -> master): Revised documentation of frobozz widget.
  0cafef00d scrot_compress: fixed rare recursion case.
  5ca1ab1e1 image_convolve: use thread pool for better performance.

by kazinator

3/31/2025 at 5:55:12 PM

Sadly, you won’t get any senior applicants if you’re mistaking the website for the tool.

by jagged-chisel

3/31/2025 at 6:03:29 PM

Here, that touch is necessary for a hint of realism.

by kazinator

4/1/2025 at 1:03:51 AM

This is cute but it works in the opposite for me, looks very unprofessional and gives the impression you get distracted with nerdy internals instead of building product.

by TZubiri

4/1/2025 at 1:26:05 AM

On the other hand, where I work we want people like that. Not every place is a CRUD slop shop with joined at the hip SPA that needs more meat for the ginder. Research and specialized optimization roles exist

by fyrn_

3/31/2025 at 10:00:46 PM

I don't get the last one?

by actinium226

3/31/2025 at 10:07:13 PM

"scalable"

by ruffrey

3/31/2025 at 5:45:41 PM

what?

by coolThingsFirst

3/31/2025 at 5:50:32 PM

Read the commit sha prefixes as English

by frutiger

3/31/2025 at 5:50:34 PM

Look at the hashes of the commits

by celegans25

3/31/2025 at 5:46:24 PM

Interesting, also this quote is as interesting as the code:

"Your job, throughout your entire life, is to disappoint as many people as it takes to avoid disappointing yourself."

by coolThingsFirst

3/31/2025 at 10:45:44 PM

That took a second to process and sink in.

Added to my shameful, neurotic HN profile.. haha, thank you!

by metadat

3/31/2025 at 1:20:10 AM

The SHA-256 hash of this sentence begins with 0573e7473.

by susam

3/31/2025 at 5:37:23 PM

The SHA256 for this sentence begins with: one, eight, two, a, seven, c and nine.

by orphea

3/31/2025 at 7:25:55 PM

Oh boy, here we go…

by tmountain

4/1/2025 at 4:01:42 AM

That's a fun way to do it! :)

by keepamovin

4/1/2025 at 1:56:02 AM

The SHA-256 hash of this sentence does not.

by akoboldfrying

4/1/2025 at 3:57:23 AM

OK, that's a cool way to fuzz the digest rather than the text :)

by keepamovin

3/31/2025 at 7:33:53 PM

Nice one.

by xeckr

3/31/2025 at 9:00:52 PM

Cool! I made a multithreaded version about 10 years that works for binary files like .zip files: https://github.com/century-arcade/src/tree/master/tools/vain...

by saulpw

4/1/2025 at 4:00:41 AM

Cool! How do you handle internal checks in the files? How does overwriting 8 zeroes not break stuff?

by keepamovin

4/1/2025 at 3:58:38 PM

Well it was intended/used to fill out a .zip file comment section, so those 8 zeroes were ignored anyway.

by saulpw

4/2/2025 at 2:41:55 AM

Smart!

by keepamovin

3/31/2025 at 5:20:17 PM

[flagged]

by ranger_danger