3个不稳定版本
0.2.0 | 2023年6月20日 |
---|---|
0.1.1 | 2023年6月18日 |
0.1.0 | 2023年6月18日 |
#1672 在 算法 中
12KB
158 行
Windows 95产品密钥生成库
有关库的更多信息,请查看文档
如果您只需要一个生成这些密钥的二进制文件,我们这里可以满足您
参考
- 密钥生成算法: https://gurney.dev/posts/mod7/
lib.rs
:
一个用于生成和验证Win95密钥的轻量级库
库的用法很简单,更多详情请查看generate
和 validate
模块
参考
- 密钥生成算法: https://gurney.dev/posts/mod7/ 生成新的有效Win95密钥
此模块中的每个函数都不接受任何参数,并返回一个包含有效密钥的 String
示例
// Import the library
use win95_keygen::generate as keygen;
fn main() {
println!("Generating a valid Windows 95 CD activation key...");
// Generate a valid CD key and print it to the console
let key: String = keygen::cd_normal();
println!("Key: {}", key);
}
检查Win95密钥的有效性
示例
// This example generates a random Win95 key, then checks it's validity
// Import the library
use win95_keygen::{generate as keygen, validate as keyvalid};
fn main() {
println!("Generating a valid Windows 95 OEM activation key...");
// Generate a valid OEM key and print it to the console
let key: String = keygen::cd_normal();
println!("Key: {}", key);
// Check if the key generated is valid
println!("Checking key validity...");
let is_valid = keyvalid::cd_normal(&key);
// If yes, log to console. Otherwise, panic
if is_valid {
println!("Key generated is valid!");
} else {
panic!("Generated erroneous key!");
}
}
依赖项
~310KB