aria2-gid 0.1.0

Aria2-Gid 是一个用于生成和解析 Aria2 GID 的库。
Documentation
  • Coverage
  • 12.5%
    1 out of 8 items documented1 out of 8 items with examples
  • Size
  • Source code size: 13.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.74 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 26s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • share121/aria2-gid
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • share121

Aria2-Gid

GitHub last commit Test MIT License

Aria2-Gid 是一个用于生成和解析 Aria2 GID 的库。

GID 是一个 64 位无符号整数,由两部分组成:

  • 高 32 位:UNIX 时间戳(秒级)
  • 低 32 位:随机数

示例

use aria2_gid::Gid;

// 生成新的 GID
let gid = Gid::new();
println!("新生成的 GID: {}", gid);

// 从十六进制字符串解析
let hex_gid: Gid = "5f9a3b801a4c3d2e".parse().unwrap();
println!("解析的 GID: {}", hex_gid);

// 获取时间戳和随机数部分
println!("时间戳: {}", gid.timestamp());
println!("随机数: {}", gid.random());