HOTP and TOTP implementation in C# targeting .NET standard 2.0, compliant with RFC 4226 (HOTP) and RFC 6238 (TOTP) and verified against supplied test vectors. The interface includes support for multiple algorithms (HMAC-SHA1, HMAC-SHA256, HMAC-SHA384, and HMAC-SHA512), code lengths (6 - 10), and an adjustable period, or time step, (1 second - 1 hour) for TOTP. The reason for creating this library was to fetch multiple HOTP counters or a TOTP time range in a single call. A parser for OTP Auth URIs is also included that conforms to the documentation found at: https://github.com/google/google-authenticator/wiki/Key-Uri-Format. This implementation also includes a Base32 encoder and decoder. It is compliant with RFC 4648, using the standard alphabet from section 6, and has been tested against the test vectors from section 10.
$ dotnet add package OtpCoreNo README available.