light-tool 0.1.1

轻量级的Rust工具库
Documentation
  • Coverage
  • 77.78%
    14 out of 18 items documented10 out of 18 items with examples
  • Size
  • Source code size: 11.48 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 653.83 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • GetcharZp/light-tool
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • GetcharZp

LightTool

一个轻量级的Rust工具库,提倡的核心理念是:基于Rust原生库、无第三方依赖

快速开始

例如 seconds() 方法(获取当前秒级时间戳),使用方法如下所示

use light_tool::timestamp;

println!("{}", timestamp::seconds());

方法列表

  • timestamp::seconds() 秒级时间戳
  • timestamp::milli_seconds() 毫秒时间戳
  • timestamp::nano_seconds() 纳秒时间戳
  • random::str() 随机字符串
  • random::num() 随机数字
  • random::alpha() 随机字母
  • random::alpha_num() 随机字母数字
  • random::range() 指定范围内的随机数 [最小值, 最大值)
  • md5::str() 获取MD5值
  • md5::salt() 获取加盐后的MD5值