@@ -15,7 +15,7 @@ namespace hmac {
1515 /// \param interval_sec Interval in seconds that defines token rotation. Default is 60 seconds
1616 /// \param hash_type Hash function to use. Default is SHA256
1717 /// \return Hex-encoded HMAC-SHA256 of the rounded time value
18- string generate_time_token (const string &key , int interval_sec = 60 , hmac ::TypeHash hash_type = hmac ::TypeHash ::HASH_SHA256 ) {
18+ string generate_time_token (const string &key , int interval_sec = 60 , hmac ::TypeHash hash_type = hmac ::TypeHash ::SHA256 ) {
1919 datetime now = TimeGMT ();
2020 datetime rounded = (now / interval_sec ) * interval_sec ;
2121 return hmac ::get_hmac (key , IntegerToString (rounded ), hash_type );
@@ -27,7 +27,7 @@ namespace hmac {
2727 /// \param interval_sec Interval in seconds that defines token rotation. Default is 60 seconds
2828 /// \param hash_type Hash function to use. Default is SHA256
2929 /// \return true if the token is valid within the ±1 interval range; false otherwise
30- bool is_token_valid (const string &token , const string &key , int interval_sec = 60 , hmac ::TypeHash hash_type = hmac ::TypeHash ::HASH_SHA256 ) {
30+ bool is_token_valid (const string &token , const string &key , int interval_sec = 60 , hmac ::TypeHash hash_type = hmac ::TypeHash ::SHA256 ) {
3131 datetime now = TimeGMT ();
3232 datetime rounded = (now / interval_sec ) * interval_sec ;
3333 if (token == get_hmac (key , IntegerToString (rounded ), hash_type )) return true ;
@@ -42,7 +42,7 @@ namespace hmac {
4242 /// \param interval_sec Interval in seconds that defines token rotation. Default is 60 seconds
4343 /// \param hash_type Hash function to use. Default is SHA256
4444 /// \return Hex-encoded HMAC-SHA256 of the concatenated timestamp and fingerprint
45- string generate_time_token (const string &key , const string &fingerprint , int interval_sec = 60 , hmac ::TypeHash hash_type = hmac ::TypeHash ::HASH_SHA256 ) {
45+ string generate_time_token (const string &key , const string &fingerprint , int interval_sec = 60 , hmac ::TypeHash hash_type = hmac ::TypeHash ::SHA256 ) {
4646 datetime now = TimeGMT ();
4747 datetime rounded = (now / interval_sec ) * interval_sec ;
4848 string payload = IntegerToString (rounded ) + " |" + fingerprint ;
@@ -56,7 +56,7 @@ namespace hmac {
5656 /// \param interval_sec Interval in seconds that defines token rotation. Default is 60 seconds
5757 /// \param hash_type Hash function to use. Default is SHA256
5858 /// \return true if the token is valid within the ±1 interval range; false otherwise
59- bool is_token_valid (const string &token , const string &key , const string &fingerprint , int interval_sec = 60 , hmac ::TypeHash hash_type = hmac ::TypeHash ::HASH_SHA256 ) {
59+ bool is_token_valid (const string &token , const string &key , const string &fingerprint , int interval_sec = 60 , hmac ::TypeHash hash_type = hmac ::TypeHash ::SHA256 ) {
6060 datetime now = TimeGMT ();
6161 datetime rounded = (now / interval_sec ) * interval_sec ;
6262 string prefix = " |" + fingerprint ;
0 commit comments