Skip to content

Instantly share code, notes, and snippets.

View nongvantinh's full-sized avatar

Nông Văn Tình nongvantinh

  • 16:44 (UTC +07:00)
View GitHub Profile
@nongvantinh
nongvantinh / generate-otp.cpp
Created September 22, 2024 09:21
C++17 implementation for one-time passwords. It provides HMAC-based and time-based implementations of one-time passwords.
// Compile: g++ generate-otp.cpp --std=c++17 -Wall -Wextra -o otp_generator
// Run: ./otp_generator
#ifndef ONE_TIME_PASSWORD_H
#define ONE_TIME_PASSWORD_H
#include <string>
#include <vector>
class OneTimePassword