Skip to content

Commit

Permalink
ddoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmanzo committed Feb 28, 2020
1 parent 0a8d385 commit 23216db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/gauthenticator.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import std.format : format;

// code adapted from https://github.com/tilaklodha/google-authenticator

// HMAC-based One Time Password(HOTP)
/// HMAC-based One Time Password(HOTP)
public string getHOTPToken(const string secret, const ulong interval)
{
//secret is a base32 encoded string. Converts to a byte array
Expand All @@ -48,7 +48,7 @@ public string getHOTPToken(const string secret, const ulong interval)
return format("%06d",h12);
}

//Time-based One Time Password(TOTP)
/// Time-based One Time Password(TOTP)
public string getTOTPToken(const string secret)
{
//The TOTP token is just a HOTP token seeded with every 30 seconds.
Expand All @@ -57,7 +57,7 @@ public string getTOTPToken(const string secret)
return getHOTPToken(secret, interval);
}

//RFC 4648
//RFC 4648 base32 implementation
private ubyte[] base32decode(const string message)
{
int buffer = 0;
Expand Down

0 comments on commit 23216db

Please sign in to comment.