{"id":19461671,"url":"https://github.com/plasmapower/brute-force","last_synced_at":"2025-07-08T00:12:56.962Z","repository":{"id":50813512,"uuid":"335828085","full_name":"PlasmaPower/brute-force","owner":"PlasmaPower","description":"A library for brute forcing arbitrary computations in Rust","archived":false,"fork":false,"pushed_at":"2021-05-28T21:20:38.000Z","size":13,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-20T15:50:04.988Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PlasmaPower.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-04T03:34:33.000Z","updated_at":"2023-01-07T19:45:17.000Z","dependencies_parsed_at":"2022-09-26T21:40:38.085Z","dependency_job_id":null,"html_url":"https://github.com/PlasmaPower/brute-force","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PlasmaPower/brute-force","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmaPower%2Fbrute-force","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmaPower%2Fbrute-force/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmaPower%2Fbrute-force/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmaPower%2Fbrute-force/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PlasmaPower","download_url":"https://codeload.github.com/PlasmaPower/brute-force/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmaPower%2Fbrute-force/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264167369,"owners_count":23567055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T17:43:19.389Z","updated_at":"2025-07-08T00:12:56.918Z","avatar_url":"https://github.com/PlasmaPower.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# brute-force: A library for brute forcing arbitrary computations in Rust\n\nThis is a library meant to take care of the repetitive tasks of spinning up\nthreads, checking if the computation is finished, returning the result, and\neven generating the inputs.\nThe adaptor system allows you to compose different helpers in a modular way,\nas not all brute forcing is as simple as proof of work.\nThe common assumption of this library is that each thread will be working off a\nstate to be the first to find a result, and the computation will end once a\nresult is found.\n\n## Simple example\n\n```rust\nuse brute_force::{brute_force, adaptors};\nuse blake2::{Blake2b, Digest};\n\n#[test]\nfn test_proof_of_work() {\n    let config = brute_force::Config::default();\n    let f = |nonce: \u0026u64| {\n        let digest = Blake2b::digest(\u0026nonce.to_le_bytes());\n        digest.as_slice()[..3] == [0; 3]\n    };\n    let nonce = brute_force(config, adaptors::output_input(adaptors::auto_advance(f)));\n    let digest = Blake2b::digest(\u0026nonce.to_le_bytes());\n    assert!(digest.as_slice()[..3] == [0; 3])\n}\n```\n\nHere, we use the `auto_advance` adaptor to automatically generate nonces for us,\nand we use the `output_input` adaptor to automatically return the input nonce\nused if a computation succeeds (instead of manually specifying the output).\n\nFor more examples, see\n[the src/tests directory](https://github.com/PlasmaPower/brute-force/tree/master/src/tests).\nFor documentation on the config and adaptors, see\n[the docs](https://docs.rs/brute-force).\n\n## Configuration\n\nYou can change the number of threads used with the environment variable\n`BRUTE_FORCE_THREADS`.\n\nInside the program, via the Config struct, you can manually override the thread\ncount or change how often this library checks if a thread should stop. You can\nalso set a timeout via the `brute_force_with_timeout` function.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasmapower%2Fbrute-force","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplasmapower%2Fbrute-force","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasmapower%2Fbrute-force/lists"}