ckc-rs

Crates.iockc-rs
lib.rsckc-rs
version0.1.15
sourcesrc
created_at2022-01-30 23:19:42.385082
updated_at2024-03-23 16:13:52.282243
descriptionPoker hand evaluation library
homepagehttps://github.com/ImperialBower/ckc-rs
repositoryhttps://github.com/ImperialBower/ckc-rs.git
max_upload_size
id524238
size520,544
Christoph (folkengine)

documentation

README

ckc-rs

License: Apache 2.0 Build and Test Crates.io Version Rustdocs

Implementation of a modified Cactus Kev's Poker Hand Evaluator library in Rust. Code inspired and lookup tables borrowed from Vladislav Supalov's pokereval-rs library, which in turn was inspired by Cactus Kev's work in C.

The primary entity in the library is a PokerCard. PokerCard is a u32 variant of Cactus Kev's binary representation of a poker card. The variation being that the Suit bits order is inverted for easier sorting by other libraries:

+--------+--------+--------+--------+
|xxxbbbbb|bbbbbbbb|SHDCrrrr|xxpppppp|
+--------+--------+--------+--------+

p = prime number of rank (deuce=2,trey=3,four=5,...,ace=41)
r = rank of card (deuce=0,trey=1,four=2,five=3,...,ace=12)
SHDC = suit of card (bit turned on based on suit of card)
b = bit turned on depending on rank of card

This library contains only the bare bones implementation of the library, and is no-std to maintain maximum utility with embedded and wasm Rust.

Possible Dependencies (if needed)

Resources

Commit count: 51

cargo fmt