pkg:clod/com.clodhub/poker-hand-ranking 0.11.0 Best five-card poker hand from five to seven cards: category, deciding ranks and kickers, comparison, winners and ties, with English names. Takes five to seven cards and returns the best five-card hand: its category, the ranks that decide it (combination ranks then kickers), a single score that orders all hands, and its English name. Also compares two hands and says how the difference was decided (category, combination or kicker, and how many kickers were read), finds the winners among contenders sharing a board (several on a tie, suits never break a tie), and rebuilds the five cards used. It reads card codes through a small card-codes object; the standard fifty-two card codes are built in and a connected card-deck may supply its own. Examples A table shows each player's hand name at showdown. A teaching screen compares two hands and says a kicker decided it. A computer player scores a candidate hand. A rules component asks for the winners of each pot. Package URL: pkg:clod/com.clodhub/poker-hand-ranking@0.11.0 Class: Poker hand ranking (pkg:clod/com.clodhub/poker-hand-ranking-class@1.1.0): Ranks five to seven cards into poker hands and finds the winners. Any component of this class can fill a recipe slot that asks for it. Category games/cards/poker; https://clodhub.com/classes/poker-hand-ranking-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Fpoker-hand-ranking-class Provides (1) - hand-ranking (com.clodhub/hand-ranking 1.0.0): The best five-card poker hand out of five to seven cards. A higher score wins; equal scores tie. TypeScript, `implementation/server/index.ts` (ranking.ts, codes.ts). Build a ranking with createHandRanking(codes) over card-deck's cardCodes, or use the ready-made handRanking; methods named `HandRanking.` are members of that object. components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Fhand-ranking Requires (1) - card-deck (com.clodhub/card-deck 1.0.0): Playing cards: create, shuffle, deal and burn, plus card codes, colours and names. Server and rules code: TypeScript `implementation/server/deck.ts`. Client card facts: TypeScript `implementation/web/cards.ts` (cardFacts, rankLabel), Swift `CardCode` (`implementation/apple/Sources/CardCodes.swift`) and Kotlin `com.clodhub.deck.CardCode` (`implementation/android/.../CardCode.kt`). Every deck operation returns a new deck and leaves its arguments unchanged. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fcard-deck Settings (0) No installer settings. Depends on components: none How to use in a recipe A recipe uses it through a slot of class Poker hand ranking (pkg:clod/com.clodhub/poker-hand-ranking-class 1.1.0), naming pkg:clod/com.clodhub/poker-hand-ranking as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (hand-ranking) to the slots that use it. It fills what the component needs (card-deck) from slots whose components provide it. It has no settings. - as a slot in recipe.json components: {"id":"poker-hand-ranking","class":{"name":"pkg:clod/com.clodhub/poker-hand-ranking-class","version":"1.1.0","digest":"8d94d3ce58cee918cc7661ecb7b862ca83bcff9922b1d03bf07f5df253be13d0"},"preferred":{"name":"pkg:clod/com.clodhub/poker-hand-ranking","version":"0.11.0"}} - in place of another component of the class: clod fetch poker-hand-ranking@0.11.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=poker-hand-ranking@0.11.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot poker-hand-ranking) For developers: how an application uses it Create one ranking with `createHandRanking()` (or `createHandRanking(codes)` with the card-deck's codes) and pass it to poker-odds, poker-strategy and holdem-rules, which take it as the hand-ranking interface. It is a pure library: no state, no timers, no randomness. TypeScript on the server and any web or desktop consumer that bundles it; the Swift and Kotlin apps never rank hands themselves (they show the names the server sends), so there is no Apple or Android code. Accounts and services No deployed service, account or key. Pure functions over card codes. How it is checked `node --test tests/server.test.ts` checks named fixture hands for every category (royal flush, wheel, steel wheel, full house from two trips, three pairs, flush under a straight, ace-high), the ordering of scores, kicker and combination reporting, ties and winners, best-five reconstruction, refusal of bad input, and agreement with an independent brute-force reference (every five-card subset of seven) on 3000 seeded hand pairs. The extraction was also compared with the recipe's evaluate.ts on 20000 random five, six and seven card hands: score, ranks and name identical. - `node --test tests/server.test.ts` (web, required-local; tools: node 26.5) Updates Removing the component removes the files under components/poker-hand-ranking/; nothing is stored. Tags: cards, games, hand, poker, ranking Targets: client none; server none Publisher: George McIntyre (george-mcintyre) Guardians: Level N Ltd (guardian key 08775f20) Source: clodhub/poker-hand-ranking release v0.11.0; digest sha256:748a0324c17d86da922c3ad0449b6b5f53c231953956c2c777142042cd619f6b Release: features Line 0.11: no security releases Quality: Integration-tested, certified Known vulnerabilities: none known (checked 2026-11-26 at OSV); https://clodhub.com/api/components/poker-hand-ranking/0.11.0/vulnerabilities Downloads: 1 in 30 days; 1 of this version Classes: https://clodhub.com/classes.txt; this component as JSON: https://clodhub.com/api/components/poker-hand-ranking/0.11.0 Bundle download: GET https://clodhub.com/api/components/poker-hand-ranking/0.11.0/bundle returns a link valid for one hour Implements: pkg:clod/com.clodhub/poker-hand-ranking-class@1.1.0 8d94d3ce58cee918cc7661ecb7b862ca83bcff9922b1d03bf07f5df253be13d0 com.clodhub/hand-ranking 1.0.0 entry modules: server server/index.ts shared behaviour suites: shared Platforms: server Toolchains: node >=26.5.0 <27.0.0 Frameworks: none Styles: scope none; 0 namespaces; 0 conflicts Licence: Apache-2.0; 0 upstream sources, 0 exact dependencies, 25 files (listed on the details page) Suitable for jobs: poker-hand-ranking profile any: cost none; load none; regions any; compliance none Notes: Pure library. Measured here only for correctness; on this machine 3000 seven-card pair comparisons against the brute-force reference take about a quarter of a second including the reference. No hosted service, account or provider limit applies. Data migration: this component keeps no data Maintainers: Level N Ltd; https://github.com/clodhub/poker-hand-ranking/issues; updates https://github.com/clodhub/poker-hand-ranking/releases (manual) What you download poker-hand-ranking-0.11.0.tar, from release v0.11.0 of clodhub/poker-hand-ranking: 25 files - Documents and manifests (8): CONTRACT.md, INSTRUCTIONS.md, LICENCE, NOTICE, PROVENANCE.md, SOURCE.md, ... - Source code (3): server/ (3) - Tests (3): fixtures/ (1), server.test.ts, support/ (1) - Interface documents (2): hand-ranking.json, required-card-deck.json - Class files: the class's interfaces and shared checks (3): poker-hand-ranking-class/ (3) - Examples (1): consumer.ts - Diagrams (5): definition.json, examples/ (1), output/ (3) Installing copies 3 of them into the application under components/poker-hand-ranking/: server 3 Not included: the components that provide what it requires (com.clodhub/card-deck), each a separate download; the values of its settings, which the recipe writes; any secret The archive is a release file on the publisher's public GitHub repository; ClodHub keeps this page and a pointer to the release, not the code. clod checks the archive's sha256 fingerprint before anything is copied, and installing runs none of the package's code. Versions - 0.11.0 features (2026-11-26T11:28:59.838Z) sha256:748a0324c17d86da922c3ad0449b6b5f53c231953956c2c777142042cd619f6b Links Details (package foundations, upstream sources, exact dependencies, styles, class inventories, files): https://clodhub.com/components/poker-hand-ranking/details.txt?version=0.11.0 Page: https://clodhub.com/components/poker-hand-ranking; JSON: https://clodhub.com/api/components/poker-hand-ranking/0.11.0; connections diagram: https://clodhub.com/api/components/poker-hand-ranking/0.11.0/connections.svg Copyright Level N Ltd 2026