#poker #mental #cards #distributed #deck #prime #key

distributed-cards

Implements the mental poker shuffling algorithm

10 releases

0.5.2 Jul 6, 2022
0.5.1 Jul 6, 2022
0.5.0 Jun 24, 2022
0.4.0 Jul 2, 2021
0.1.0 Jun 7, 2021

#1434 in Algorithms

Download history 20/week @ 2024-02-19 2/week @ 2024-02-26 9/week @ 2024-03-11 251/week @ 2024-04-01

260 downloads per month

LGPL-3.0

24KB
546 lines

Distributed cards implements the card shuffling algorithm described in the Mental Poker Wikipedia page for n cards.

The crate resolves around the [Deck] struct.

To serialize/deserialize Primes and Rsa keys, they have be converted into the Unchecked variants.

Example usage

use distributed_cards::{Deck, Prime};
use rand::prelude::*;

let mut rng = thread_rng();

// can be reused in each game list of primes from all players has to be collected before the
// shuffling can start
let p = Prime::random(512, &mut rng);

Dependencies

~2.7–3.5MB
~78K SLoC