EmPOWer your commits with Rust!

Overview

git-power-rs

What is this?

Make your git tree into a blockchain! Inspired by this project, I noticed that there was a call to Rewrite it in Rust™, so I decided to tackle it as a way to learn about multithreading in Rust. More details on the What and Why can be found in the above repo.

How fast does it go?

On my Ryzen 3600 @ 3.6 GHz with 12 threads, it achieves 54 MH/s peak, with this figure decreasing for longer commit messages (this includes signed commits). So, if you want to set the leading 8 digits of your commit to 0, that's 2^32 / 54000000 ~= 80 seconds, though variance is pretty high depending on the commit in question.

Building

Just run cargo build.

Installing

Run cargo install --path ., and the binary will be copied to $CARGO_HOME/bin. Make sure you have this directory in your $PATH, at which point you'll be able to invoke it through git itself via git power.

Usage

git-power 0.1.0

USAGE:
    git-power [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -b, --bits            [default: 32]
    -t, --threads 

By default, git powre will brute-force the HEAD commit of the repository located in the current directory to start with 32 zero bits, and will use all available logical cores to perform the computation. If you want to apply this to multiple commits at a time, and not just the most recent one, perform an interactive rebase like so:

">
git rebase --interactive --exec "git power" 

The reference you give can be any git object, for example --root, origin/master, or a specific commit hash.

Possible Further Optimization

  • Improve SHA-1 caching - Based on prior work, it seems that there is space for optimizing the SHA-1 state to prevent redundant computation.
  • Use OpenCL to run it on GPUs - According to hashcat, my Radeon 5700XT is capable of a hashrate several hundred times higher than what I'm currently achieving just on my CPU.

Feedback is appreciated for any other possible optimization improvements.

You might also like...
A GitHub Action to automatically build and deploy your mdbook project.

📘 deploy-mdbook The deploy-mdbook action allows you to easily build and deploy your mdBook project to GitHub Pages. See action.yml for configuration

Telegram bot to fetch images from Terceira Ponte and Rodosol into your Telegram chat.

rodosol-telegram-bot Add this bot to your contacts list This bot is a quick scraper that gets the pictures from the rodosol "De olho na via" feature a

Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction.

Paru Feature packed AUR helper Description Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction. Installatio

Document your crate's feature flags

Document your crate's feature flags This crate provides a macro that extracts documentation comments from Cargo.toml To use this crate, add #![doc = d

Notifiy when one of Elon Musk's jets flyover your own ADS-B receiver

With inpsiration from twitter/@ElonJet, this app will print notifications when one of Elon Musk's jets fly over your own ADS-B receiver ground station.

A server to continously poll nearly always-on sites to verify that your internet connectivity stays up

Dead Router A server to continously poll nearly always-on sites to verify that your internet connectivity stays up! If one or more of the servers stop

Add toast support in your dioxus project

Add toast support in your dioxus project

Envwoman is an application, to sync your .env-files across multiple machines

Envwoman is an application, to sync your .env-files across multiple machines. The main goal is to make Envwoman secure and trustworthy, so everything is open-source and the data will never in plain-text on the server. Encryption happens client-sided via aes-gcm.

Automatic wallpaper downloader of posters of your favorite movies and TV shows via TMDb.

Wallpaperflix Automatic wallpaper downloader of posters of your favorite movies and TV shows via TMDb. Prerequisities https://tauri.app/v1/guides/gett

Comments
  • [Feature] Hash until Abort

    [Feature] Hash until Abort

    It would be useful if the tool could instead of having some number of bits to target, it would show me how many bits it has and hashes until I press Ctrl-C (or some other input) or maybe until some time limit has passed (ie, always run for 10 minutes, regardless of how many bits that is).

    opened by cultpony 2
Owner
Michael Krasnitski
Michael Krasnitski
A stupid macro that compiles and executes Rust and spits the output directly into your Rust code

inline-rust This is a stupid macro inspired by inline-python that compiles and executes Rust and spits the output directly into your Rust code. There

William 19 Nov 29, 2022
Log your spending in seconds with short text snippets. Powered by Rust, Cloudflare Workers and Svelte.

FastSpend Log your daily spending lightning fast with short text snippets! FastSpend is a tool to log your spending in seconds, powered by a lightning

Phoomparin Mano 24 Sep 13, 2022
Fetch all your fetches, but in rust

fetchfetch, but in rust Fetch all of your fetches. written in go rust. Installation You can either download the latest release or build from source (r

null 4 May 7, 2023
Very simple Rust binary that can turn on/off a TP-Link L920 led light strip in your local network

TP-Link L920 on/off script This is a (very) simple Rust binary that can turn on/off a TP-Link L920 led light strip in your local network. Installation

Luciano Mammino 3 Aug 21, 2023
A blazinlgy fast 🚀 transpiler written in rust 🦀 that fixes (pun intended) your problems

Pissfix ?? Pissfix is a blazingly fast ?? programming language that transpiles to a "interesting" and not well known programming language called "Post

null 3 Sep 28, 2023
The simplest way to de-Google your life and business: Inbox, Calendar, Files, Contacts & much more

Bloom The all-in-one private workspace Try it for free! You no longer trust tech monopolies with your data? You are done with your privacy invaded by

Sylvain Kerkour 1.6k Dec 26, 2022
Autorebase automatically rebases all of your feature branches onto master.

Autorebase automatically rebases all of your feature branches onto master. If conflicts are found it will rebase to the last commit that doesn't cause conflicts. By default, branches with an upstream are excluded. You don't need to switch to any branch, the only limitation is that a branch that is checked out and not clean will not be rebased (though I may add that in future).

Tim 66 Nov 26, 2022
Play Onitama in your browser, compete with friends or lose to a bot

Play Onitama in your browser, compete with friends or lose to a bot

Jack Adamson 52 Nov 12, 2022
Tells you how many years you need to wait until your subatomic xeon crystal synchronizer has doubled in plasma inversion efficiency on the Goldberg-Moleman scale or whatever.

about Tells you how many years you need to wait until your subatomic xeon crystal synchronizer has doubled in plasma inversion efficiency on the Goldb

null 2 Dec 3, 2021
Common processing blocks used with your Runes.

Common Processing Blocks (API Docs) Processing blocks built by Hammer of the Gods that you can use with your Runes. License This project is licensed u

Hammer of the Gods 9 Jul 21, 2022