8000 GitHub - Luukdegram/otp: Simple, basic OTP library written in Zig.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Luukdegram/otp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTP

Test

OTP is a one-time-password library supporting both HOTP and TOTP according to RFC 4226 and RFC 6238.

Currently only the generation of codes is supported. Verification has to be done by the implementation.

note

This library's primary goal was to get more familair with the Zig language.

Example

const std = @import("std");
const otp = @import("otp");
const warn = std.debug.warn;

pub fn main() !void {
    const hotp = otp.Hotp.init();
    const code = try hotp.generateCode("secretkey", 0);
    warn("code: {}\n", .{code});
}

You can use the build.zig file as reference point on how to link the library to your own project.

Tests

You can run the tests using the following command 5F69

zig build

About

Simple, basic OTP library written in Zig.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages

0