{"id":16707912,"url":"https://github.com/syuilo/hyperbool","last_synced_at":"2026-02-05T23:01:20.402Z","repository":{"id":40624704,"uuid":"507777900","full_name":"syuilo/hyperbool","owner":"syuilo","description":"A cosmic ray-tolerant, highly reliable logical operation library","archived":false,"fork":false,"pushed_at":"2022-06-27T05:59:51.000Z","size":1,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-11T16:51:30.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syuilo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-27T05:43:58.000Z","updated_at":"2024-06-11T05:01:09.000Z","dependencies_parsed_at":"2022-09-15T09:12:39.876Z","dependency_job_id":null,"html_url":"https://github.com/syuilo/hyperbool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/syuilo/hyperbool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syuilo%2Fhyperbool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syuilo%2Fhyperbool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syuilo%2Fhyperbool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syuilo%2Fhyperbool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syuilo","download_url":"https://codeload.github.com/syuilo/hyperbool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syuilo%2Fhyperbool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29137750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T22:49:08.052Z","status":"ssl_error","status_checked_at":"2026-02-05T22:45:32.059Z","response_time":65,"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":[],"created_at":"2024-10-12T19:41:26.659Z","updated_at":"2026-02-05T23:01:20.383Z","avatar_url":"https://github.com/syuilo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# hyperbool\n\n宇宙線に耐性のある高信頼な論理演算を行うための(ジョーク)ライブラリ。\n\n## Why\n通常の真理値は、メモリ上の1bitのデータに過ぎないため、宇宙線などの放射線に脆弱です。\n例えば以下のようなコードでも、if文が実行されないという保証はありません。\n\n```ts\nconst normalBool = false;\n\nif (normalBool) {\n  // 宇宙線が normalBool を true に書き換えるかもしれないので、実行されることもある\n  console.log('never reached (hopefully)');\n}\n```\n\nhyperboolを使えば、このような宇宙線の影響を最小限に抑えることができます。\n\n## 超真理値\nhyperboolは宇宙線に耐性のある真理値(超真理値)を提供します。\n\n超真理値の実態は通常の真理値の配列で、例えば真を表す超真理値は以下のようなデータとしてメモリに配置されます。\n\n``` ts\n[true, true, true, true, true,\n true, true, true, true, true,\n true, true, true, true, true,\n true, true, true, true, true,\n true, true, true, true, true]\n```\n\n超真理値が真であるかどうかは、配列内のtrueである要素の数が、falseである要素の数より多いか否かで決定されます。\n\n仮に宇宙線がメモリに干渉して以下のようにデータが変わったとしても、\n\n``` ts\n[true, true, true, true, true,\n true, true, true, true, true,\n true, true, false, true, true,\n true, true, true, false, true,\n true, true, true, true, true]\n```\n\n依然 true の方が多いので超真理値としては 真 の状態が保たれます。\n\n偽の扱いも真の場合と同様の考え方です。\n\n## 耐性度\n配列の中にどれくらい要素を格納するか設定できます。\n当然多ければ多いほど宇宙線への耐性は高まりますが、メモリ使用量が増えます。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyuilo%2Fhyperbool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyuilo%2Fhyperbool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyuilo%2Fhyperbool/lists"}