{"id":23191277,"url":"https://github.com/chehsunliu/poker","last_synced_at":"2025-08-18T19:32:19.951Z","repository":{"id":57488269,"uuid":"141579458","full_name":"chehsunliu/poker","owner":"chehsunliu","description":"A pure Go library for poker hand evaluation.","archived":false,"fork":false,"pushed_at":"2023-04-17T05:48:36.000Z","size":16,"stargazers_count":70,"open_issues_count":0,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-06T10:40:47.949Z","etag":null,"topics":["go","golang","poker","texas-holdem","texasholdem"],"latest_commit_sha":null,"homepage":"","language":"Go","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/chehsunliu.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":"2018-07-19T12:55:06.000Z","updated_at":"2025-03-01T16:12:42.000Z","dependencies_parsed_at":"2024-06-18T17:00:57.708Z","dependency_job_id":"d82d2db2-96ab-4aa1-b4e9-a7560dd6aaed","html_url":"https://github.com/chehsunliu/poker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chehsunliu/poker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chehsunliu%2Fpoker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chehsunliu%2Fpoker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chehsunliu%2Fpoker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chehsunliu%2Fpoker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chehsunliu","download_url":"https://codeload.github.com/chehsunliu/poker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chehsunliu%2Fpoker/sbom","scorecard":{"id":275542,"data":{"date":"2025-08-11","repo":{"name":"github.com/chehsunliu/poker","commit":"72fcd0dd66288388735cc494db3f2bd11b28bfed"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/chehsunliu/poker/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/chehsunliu/poker/build.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T14:18:22.180Z","repository_id":57488269,"created_at":"2025-08-17T14:18:22.181Z","updated_at":"2025-08-17T14:18:22.181Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271049162,"owners_count":24690982,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","golang","poker","texas-holdem","texasholdem"],"created_at":"2024-12-18T12:16:45.866Z","updated_at":"2025-08-18T19:32:19.679Z","avatar_url":"https://github.com/chehsunliu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Poker\n\n[![Build](https://github.com/chehsunliu/poker/actions/workflows/build.yml/badge.svg)](https://github.com/chehsunliu/poker/actions/workflows/build.yml)\n[![GoDoc](https://godoc.org/github.com/chehsunliu/poker?status.svg)](https://godoc.org/github.com/chehsunliu/poker)\n\nPoker is ported from the Python library [worldveil/deuces](https://github.com/worldveil/deuces).\n\n## Installation\n\nUse `go get` to install Poker:\n\n```sh\n$ go get github.com/chehsunliu/poker\n```\n\n## Usage\n\nSupport 5-, 6-, and 7-card evalutions:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/chehsunliu/poker\"\n)\n\nfunc main() {\n\tdeck := poker.NewDeck()\n\thand := deck.Draw(7)\n\tfmt.Println(hand)\n\n\trank := poker.Evaluate(hand)\n\tfmt.Println(rank)\n\tfmt.Println(poker.RankString(rank))\n}\n```\n\n```sh\n$ go run ./main.go\n[Kd 4h Qh 3s 8s 5h Jd]\n6695\nHigh Card\n\n$ go run ./main.go\n[4c Qh Ad 9c 9s 3h 4d]\n3062\nTwo Pair\n\n$ go run ./main.go\n[Jh Qd Kd Qs 7d As Qh]\n1742\nThree of a Kind\n```\n\n## Performance\n\nCompared with [notnil/joker](https://github.com/notnil/joker), Poker is 160x faster on 5-card evaluation, and drops to 40x faster on 7-card evaluation.\n\n```sh\ngo test -bench=. -benchtime 5s\ngoos: darwin\ngoarch: amd64\npkg: github.com/chehsunliu/poker\nBenchmarkFivePoker-4    \t23396181\t       253 ns/op\nBenchmarkFiveJoker-4    \t  141036\t     41662 ns/op\nBenchmarkSixPoker-4     \t 3037298\t      1949 ns/op\nBenchmarkSixJoker-4     \t   28158\t    211533 ns/op\nBenchmarkSevenPoker-4   \t  356448\t     16357 ns/op\nBenchmarkSevenJoker-4   \t    7143\t    759394 ns/op\nPASS\nok  \tgithub.com/chehsunliu/poker\t40.111s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchehsunliu%2Fpoker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchehsunliu%2Fpoker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchehsunliu%2Fpoker/lists"}