otpauth-用于Rust的HOTP / TOTP的两步验证-Rust开发

时间:2021-05-27 20:08:43
【文件属性】:
文件名称:otpauth-用于Rust的HOTP / TOTP的两步验证-Rust开发
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-27 20:08:43
Rust Authentication otpauth-rs用于Rust的HOTP / TOTP的两步验证。 安装将其添加到您的Cargo.toml中:[dependencies] otpauth =“ 0.3”示例HOTP示例u otpauth-rs Rust的HOTP / TOTP的两步验证。 安装将其添加到您的Cargo.toml中:[dependencies] otpauth =“ 0.3”示例HOTP示例使用otpauth :: HOTP; fn main(){let auth = HOTP :: new(“ python”); 让代码= auth.generate(4); assert_eq!(true,auth.verify(code,0,100)); } TOTP示例使用std :: time :: {SystemTime,UNIX_EPOCH}; 使用otpauth :: TOTP; fn main(){let auth = TOTP :: new(“ python”); 让timestamp1 = SystemTime :: now()。duration_since
【文件预览】:
otpauth-rs-master
----.gitignore(18B)
----src()
--------totp.rs(3KB)
--------lib.rs(984B)
--------hotp.rs(3KB)
----.travis.yml(1KB)
----LICENSE(1KB)
----Cargo.toml(500B)
----README.md(1KB)
----tests()
--------lib.rs(1KB)
----appveyor.yml(372B)
----rustfmt.toml(59B)

网友评论