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

distributed-cards

实现了心理扑克洗牌算法

10个版本

0.5.2 2022年7月6日
0.5.1 2022年7月6日
0.5.0 2022年6月24日
0.4.0 2021年7月2日
0.1.0 2021年6月7日

#1628 in 算法

LGPL-3.0

24KB
546

Distributed cards实现了在n张牌中描述的心理扑克洗牌算法,参见心理扑克维基页面

该crate围绕[Deck]结构实现。

为了序列化/反序列化素数和RSA密钥,它们必须转换为Unchecked变体。

示例用法

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);

依赖项

~2.6–3.5MB
~77K SLoC