5 个版本

0.2.6 2022年5月18日
0.2.2 2022年5月18日
0.2.1 2022年5月18日
0.2.0 2022年5月16日
0.1.0 2022年5月9日

#589 in 身份验证

GPL-3.0 许可证

19KB
231

uniqueid 🔍

根据一组参数生成系统的唯一哈希/标识符。

示例用法

   use uniqueid::{IdentifierBuilder, IdentifierType};

   let mut builder = IdentifierBuilder::default();
   
   builder.name("test");
   builder.add(IdentifierType::CPU);
   builder.add(IdentifierType::RAM);
   builder.add(IdentifierType::DISK);

   let identifier = builder.build();

   println!("{}", identifier.to_string(false)); // false = do not hash the identifier (useful for debugging)

规范

UniqueID uses its own specification.

The spec consists of three parts:
    - The Identifier; []
    - The IdentifierType; ()
    - The IdentifierTypeData; (a=b, ...)
      
A basic identifier would look like this: 

NAME[TYPE(a=b, ...), ...]

NAME - Optional name of the identifier. (Can be used as a label or salt)
TYPE - The type of identifier, e.g. CPU, GPU, etc.
DATA - The data for the identifier, e.g. Vendor=Intel, Model=Xeon E5-2670

This is a very basic example of an identifier, and most use cases will have more types, more data, and hash the output.

路线图

  • 在库中计算基于系统硬件的 HWID,无需手动指定。
  • 添加对其他标识符类型的支持。(目前仅支持 CPU、RAM 和 DISK) - 欢迎 PR
  • 添加磁盘序列号检查。
  • 添加对其他哈希算法的支持。(目前仅支持 SHA3-512)

许可证

本软件许可协议为 GNU 通用公共许可证 v3.0

有关更多信息,请参阅本项目根目录中的 LICENSE 文件或此处

依赖项

~2MB
~29K SLoC