Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero-pad auth code #25

Merged
merged 1 commit into from
Oct 16, 2020
Merged

Zero-pad auth code #25

merged 1 commit into from
Oct 16, 2020

Conversation

tyilo
Copy link
Contributor

@tyilo tyilo commented Oct 15, 2020

oath::totp_raw_now doesn't zero-pad the result.

For example the following code outputs 3406 instead of 003406:

extern crate oath;

use oath::{totp_raw_custom_time, HashType};

fn main () {
    let res = totp_raw_custom_time(b"12345678901234567890", 6, 0, 30, 26*365*24*60*60, &HashType::SHA1);
    println!("{}", res);
}

@doy doy merged commit befd4c7 into doy:master Oct 16, 2020
@doy
Copy link
Owner

doy commented Oct 16, 2020

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants