From 8898f466a008adc54e909164f9acc0ba0c5714da Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 13 Nov 2024 02:27:51 +0200 Subject: [PATCH] Remove unneeded to_string functions --- example/hash2sum.cpp | 15 --------------- test/hmac_sha2.cpp | 16 ---------------- 2 files changed, 31 deletions(-) diff --git a/example/hash2sum.cpp b/example/hash2sum.cpp index 8cb3323..729fd69 100644 --- a/example/hash2sum.cpp +++ b/example/hash2sum.cpp @@ -14,21 +14,6 @@ #include #include -template std::string to_string( std::array const & v ) -{ - std::string r; - - for( std::size_t i = 0; i < N; ++i ) - { - char buffer[ 8 ]; - std::snprintf( buffer, sizeof( buffer ), "%02x", static_cast( v[ i ] ) ); - - r += buffer; - } - - return r; -} - template void hash2sum( std::FILE* f, char const* fn ) { Hash hash; diff --git a/test/hmac_sha2.cpp b/test/hmac_sha2.cpp index 41b1612..ca45174 100644 --- a/test/hmac_sha2.cpp +++ b/test/hmac_sha2.cpp @@ -30,22 +30,6 @@ std::string from_hex( char const* str ) return s; } -template std::string to_string( std::array const & v ) -{ - std::string r; - - for( std::size_t i = 0; i < N; ++i ) - { - char buffer[ 8 ]; - - std::snprintf( buffer, sizeof( buffer ), "%02x", static_cast( v[ i ] ) ); - - r += buffer; - } - - return r; -} - template std::string digest( std::string const & k, std::string const & s ) { H h( reinterpret_cast( k.data() ), k.size() );