From 6cd32b5193cb65ff897feeeba4cad0b12f659ac8 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sun, 5 Sep 2021 21:08:10 +0200 Subject: [PATCH] Removed randomString() --- src/esprandom.h | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/esprandom.h b/src/esprandom.h index eac63c3..de2a806 100644 --- a/src/esprandom.h +++ b/src/esprandom.h @@ -2,15 +2,11 @@ // system includes #include -#include -#include -#include // esp-idf includes #include namespace espcpputils { -namespace { class esp_random_device { @@ -24,21 +20,4 @@ public: static result_type max() { return std::numeric_limits::max(); } }; -std::string randomString(std::size_t length) -{ - static constexpr auto chars = - "0123456789" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz"; - - auto rng = esp_random_device{}; - - auto dist = std::uniform_int_distribution{{}, std::strlen(chars) - 1}; - - auto result = std::string(length, '\0'); - std::generate_n(std::begin(result), length, [&]() { return chars[dist(rng)]; }); - return result; -} - -} // namespace } // namespace espcpputils