From b0efcd5847c274ebe3f98e9fbeca2f0771f16287 Mon Sep 17 00:00:00 2001 From: Aster Seker Date: Sat, 6 Sep 2025 02:28:16 +0300 Subject: [PATCH] docs(readme): update HMAC string overload prototype --- README-RU.md | 9 ++++----- README.md | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README-RU.md b/README-RU.md index c8c2c1d..4847f49 100644 --- a/README-RU.md +++ b/README-RU.md @@ -82,12 +82,11 @@ string hash = hmac::get_hmac("key", "message", hmac::TypeHash::SHA256); ```cpp std::string get_hmac( - std::string key, + const std::string& key, const std::string& msg, - const TypeHash type, + TypeHash type, bool is_hex = true, - bool is_upper = false -); + bool is_upper = false); ``` Параметры: @@ -100,7 +99,7 @@ std::string get_hmac( Возвращает: Если `is_hex == true`, возвращает HMAC в виде hex-строки (`std::string`). -Если `is_hex == false`, возвращает HMAC в виде бинарной строки (`std::string`, не предназначена для вывода). +Если `is_hex == false`, возвращает бинарную строку; для бинарного вывода предпочтительнее перегрузка со `std::vector`. #### Безопасная работа со строковыми ключами diff --git a/README.md b/README.md index 2d18e90..6fb7032 100644 --- a/README.md +++ b/README.md @@ -110,12 +110,11 @@ string hash = hmac::get_hmac("key", "message", hmac::TypeHash::SHA256); ```cpp std::string get_hmac( - std::string key, + const std::string& key, const std::string& msg, - const TypeHash type, + TypeHash type, bool is_hex = true, - bool is_upper = false -); + bool is_upper = false); ``` Parameters: @@ -128,7 +127,7 @@ Parameters: Returns: If `is_hex == true`, returns a hexadecimal string (`std::string`) of the HMAC. -If `is_hex == false`, returns a raw binary HMAC as a `std::string` (not human-readable). +If `is_hex == false`, returns a raw binary string; for binary output, prefer the `std::vector` overload. #### Secure handling of string keys