SHA256 sentence: discover a SHA256 checksum that matches a sentence's description of hex digit words.

Overview

SHA256 sentence

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

Inspired by @lauriewired post

Inspired by @humblehack post

Discussion on Hacker News

This repo has Rust implementations of a coding challenge that searches for a sentence that describes its own SHA256 checksum.

This repo contains two Rust complete projects.

Rust with basics

The /rust-with-basics project directory demonstrates:

  • Iteration via the standard library. This is without parallelization.

  • Permutation via the itertools crate. This is without replacement.

  • A local system time variable. This is without multi-thread safety.

Output:

milliseconds: 3, digest: "0b62c3f1bf41205f419fd37a3e028e65a054d6ba913b10711ef53073e9096c85", starts: "0b62", sentence: "The SHA256 for this sentence begins with: zero, b, six and two."
milliseconds: 54, digest: "0ed8f8c1e8ab4f84ee6503a39a9973e57cc6f7065862ac69c34a6126708b6269", starts: "0ed8f", sentence: "The SHA256 for this sentence begins with: zero, e, d, eight and f."
milliseconds: 8288, digest: "182a7c930b0e5227ff8d24b5f4500ff2fa3ee1a57bd35e52d98c6e24c2749ae0", starts: "182a7c9", sentence: "The SHA256 for this sentence begins with: one, eight, two, a, seven, c and nine."

Rust with extras

The /rust-with-extras project directory demonstrates:

  • Parallel iteration via the rayon crate.

  • Permutation with replacement via Rosetta code permutation_with_replacement.

  • A global system time variable via once_cell single-initialization multi-thread safety.

Output:

milliseconds: 14, digest: "0b62c3f1bf41205f419fd37a3e028e65a054d6ba913b10711ef53073e9096c85", starts: "0b62", sentence: "The SHA256 for this sentence begins with: zero, b, six and two."
milliseconds: 698, digest: "f0dfc81ccecc48f6ee0a50ced43f3abe78d5c4ab2ccaa4f582d93d103ff7db90", starts: "f0dfc", sentence: "The SHA256 for this sentence begins with: f, zero, d, f and c."
milliseconds: 823, digest: "0ed8f8c1e8ab4f84ee6503a39a9973e57cc6f7065862ac69c34a6126708b6269", starts: "0ed8f", sentence: "The SHA256 for this sentence begins with: zero, e, d, eight and f."
milliseconds: 3077, digest: "443bd2f109b49619afa402953babe11b0d95eac073129a04ce89c37ca5c3e253", starts: "443bd2", sentence: "The SHA256 for this sentence begins with: four, four, three, b, d and two."
milliseconds: 125985, digest: "182a7c930b0e5227ff8d24b5f4500ff2fa3ee1a57bd35e52d98c6e24c2749ae0", starts: "182a7c9", sentence: "The SHA256 for this sentence begins with: one, eight, two, a, seven, c and nine."
…
You might also like...
Rust port of sentence-transformers (https://github.com/UKPLab/sentence-transformers)

Rust SBert Rust port of sentence-transformers using rust-bert and tch-rs. Supports both rust-tokenizers and Hugging Face's tokenizers. Supported model

`grep` but with PEG patterns. Define grammars (e.g. `digit`), functions for matching. No more regex syntax!

PEG peggrep Example file demo_file: THIS LINE IS THE 1ST UPPER CASE LINE IN THIS FILE. this line is the 1st lower case line in this file. This Line Ha

Uindex is a data store, for data that can be parsed as sentences in some context-free language.
Uindex is a data store, for data that can be parsed as sentences in some context-free language.

Uindex - Universal index Uindex is a data store, for data that can be parsed as sentences in some context-free language.

Generate easy to remember sentences that acts as human readable UUIDs 🥳

uuid-readable-rs Easy to remember unique sentences acting as UUID Generate easy to remember sentences that acts as human readable UUIDs. Built on UUID

A silly program written in Rust to output nonsensical sentences in the command line interface.

A silly program written in Rust to output nonsensical sentences in the command line interface.

a nom parser combinator that matches a psql statement.

psql_splitter a nom parser combinator that matches a psql statement. Postgres has a dialect of SQL that I'm going to call pgsql. Postgres also has a c

Utility to quickly setup Starcraft Broodwar matches between 2 or more bots

BWAIShotgun Utility to quickly setup Starcraft Broodwar matches between 2 or more bots Be aware that all bots will be executed directly, without any l

Rust crate for reconstructing Arabic sentences to be used in applications that don't support Arabic

Arabic Reshaper Rust Reconstruct Arabic sentences to be used in applications that don't support Arabic script. Usage: resahpe a single line of string

Reef: A zkSNARK system for proving that a committed document matches a regex

Reef This is an implementation of Reef, a system for generating zero-knowledge proofs that a committed document matches or does not match a regular ex

Semantic text segmentation. For sentence boundary detection, compound splitting and more.

NNSplit A tool to split text using a neural network. The main application is sentence boundary detection, but e. g. compound splitting for German is a

A rule based sentence segmentation library.

cutters A rule based sentence segmentation library. 🚧 This library is experimental. 🚧 Features Full UTF-8 support. Robust parsing. Language specific

Implementation of sentence embeddings with BERT in Rust, using the Burn library.
Implementation of sentence embeddings with BERT in Rust, using the Burn library.

Sentence Transformers in Burn This library provides an implementation of the Sentence Transformers framework for computing text representations as vec

Custom memory allocator that helps discover reads from uninitialized memory

libdiffuzz: security-oriented alternative to Memory Sanitizer This is a drop-in replacement for OS memory allocator that can be used to detect uses of

Custom memory allocator that helps discover reads from uninitialized memory

libdiffuzz: security-oriented alternative to Memory Sanitizer This is a drop-in replacement for OS memory allocator that can be used to detect uses of

⚙️ Crate to discover embedded programming with uno r3 project

⚙️ Crate to discover embedded programming with uno r3 project

Discover GitHub token scope permission and return you an easy interface for checking token permission before querying GitHub.

github-scopes-rs Discover GitHub token scope permission and return you an easy interface for checking token permission before querying GitHub. In many

Check for SHA256 collisions.
Check for SHA256 collisions.

Coll SHA256 Collision Finder What's This? I was curious how long it might take to find a collision for an SHA256 hash created from an arbitrary file o

MD5/SHA256 HASH ATTACK IN RUST
MD5/SHA256 HASH ATTACK IN RUST

hashraccoon Installation Install cargo curl https://sh.rustup.rs -sSf | sh Install the hashraccoon crate cargo install hashraccoon Download the rockyo

SQLite Extension adding various hashing functions like MD5, SHA1, SHA256, SHA512, etc.

sqlite-hashes Use this crate to add various hash functions to SQLite, including MD5, SHA1, SHA256, and SHA512. This crate uses rusqlite to add user-de

Owner
Joel Parker Henderson
Software developer. Technology consultant. Creator of GitAlias.com, NumCommand.com, SixArm.com, and many open source projects.
Joel Parker Henderson
Generate easy to remember sentences that acts as human readable UUIDs 🥳

uuid-readable-rs Easy to remember unique sentences acting as UUID Generate easy to remember sentences that acts as human readable UUIDs. Built on UUID

Martin André 48 Nov 8, 2022
Semantic text segmentation. For sentence boundary detection, compound splitting and more.

NNSplit A tool to split text using a neural network. The main application is sentence boundary detection, but e. g. compound splitting for German is a

Benjamin Minixhofer 273 Dec 29, 2022
A rule based sentence segmentation library.

cutters A rule based sentence segmentation library. ?? This library is experimental. ?? Features Full UTF-8 support. Robust parsing. Language specific

null 11 Jul 29, 2022
Implementation of sentence embeddings with BERT in Rust, using the Burn library.

Sentence Transformers in Burn This library provides an implementation of the Sentence Transformers framework for computing text representations as vec

Tyler Vergho 4 Sep 4, 2023
Which words can you spell using only element abbreviations from the periodic table?

Periodic Words Have you ever wondered which words you can spell using only element abbreviations from the periodic table? Well thanks to this extremel

J Spencer 11 Apr 26, 2021
Probabilistically split concatenated words using NLP based on English Wikipedia unigram frequencies.

Untanglr Untanglr takes in a some mangled words and makes sense out of them so you dont have to. It goes through the input and splits it probabilistic

Andrei Butnaru 15 Nov 23, 2022
Common stop words in a variety of languages

About Stop words are words that don't carry much meaning, and are typically removed as a preprocessing step before text analysis or natural language p

Chris McComb 9 Dec 9, 2022
Predict next words (`・ω・´)

Mocword Predict next words (`・ω・´) Installation Important: You must prepare Mocword dataset in advance. See below (Dataset and Environment Variable).

high-moctane 36 Dec 3, 2022
An opinionated, better system for spelling words in English.

ingLix / ˈɪŋ glɪʃ / English done right. An opinionated, better system for spelling words in English. Preamble Click to expand. The English language is

Nicholas Omer Chiasson 6 Aug 8, 2022
A small CLI utility for helping you learn japanese words made in rust 🦀

Memofante (Clique aqui ver em português) Memofante is here, a biiiig help: Do you often forget japanese words you really didn't want to forget? Do you

Tiaguinho 3 Nov 4, 2023