{"id":18260067,"url":"https://github.com/roppa/luck","last_synced_at":"2026-04-29T19:33:21.840Z","repository":{"id":146092745,"uuid":"186260030","full_name":"roppa/luck","owner":"roppa","description":"Bitcoin mining luck generator","archived":false,"fork":false,"pushed_at":"2019-05-12T13:49:18.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T23:06:26.353Z","etag":null,"topics":["bitcoin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/roppa.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-12T13:41:37.000Z","updated_at":"2021-10-20T01:25:34.000Z","dependencies_parsed_at":"2023-05-14T06:00:13.520Z","dependency_job_id":null,"html_url":"https://github.com/roppa/luck","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roppa/luck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roppa%2Fluck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roppa%2Fluck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roppa%2Fluck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roppa%2Fluck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roppa","download_url":"https://codeload.github.com/roppa/luck/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roppa%2Fluck/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32441128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bitcoin"],"created_at":"2024-11-05T10:41:53.752Z","updated_at":"2026-04-29T19:33:21.824Z","avatar_url":"https://github.com/roppa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitcoin Block Luck Calculation\n\nThis is a utility for Bitcoin miners/mining pools to calculate the 'luck' of mining a block.\n\nWhen a block has been mined you need to save when the block was started mined (created) and the mined at (when a hash has been found) timestamps.\n\nFirst we need to cover constant values:\n\n- hash = 2 pow 32\n- PHz per second = 10 pow 15\n- block average = hash * PHz per second\n\nTo calculate luck you need how long it took to mine the block, your total hashrate, and network difficulty. Eg:\n\n- difficulty = 336899932795 // network difficulty\n- hashrate = total hashrate of mined block\n- minedTimeSeconds = (minedat - created) in seconds\n\n## luck({ difficulty, hashrate, minedTimeSeconds })\n\n```javascript\nconsole.log(luck({\n  difficulty: 336899932795\n  hashrate: 154.9, // block hashrate\n  minedTimeSeconds: 9172 // how long block took to mine\n})) // '102.71'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froppa%2Fluck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froppa%2Fluck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froppa%2Fluck/lists"}