summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/base64.cpp4
-rw-r--r--src/utils/sha256.cpp6
-rw-r--r--src/utils/stringutils.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp
index cf10c8fd..189407d7 100644
--- a/src/utils/base64.cpp
+++ b/src/utils/base64.cpp
@@ -29,8 +29,8 @@
#include "utils/base64.h"
-#include <stdlib.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstring>
static char base64_table[] =
{
diff --git a/src/utils/sha256.cpp b/src/utils/sha256.cpp
index a97dce3c..a18e5f18 100644
--- a/src/utils/sha256.cpp
+++ b/src/utils/sha256.cpp
@@ -265,10 +265,10 @@ std::string SHA256Hash(const char *src, int len)
// Convert it to hex
const char* hxc = "0123456789abcdef";
std::string hash = "";
- for (int i = 0; i < SHA256_DIGEST_SIZE; i++)
+ for (unsigned char i : bytehash)
{
- hash += hxc[bytehash[i] / 16];
- hash += hxc[bytehash[i] % 16];
+ hash += hxc[i / 16];
+ hash += hxc[i % 16];
}
return hash;
}
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 59a3f17d..5083770c 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -23,7 +23,7 @@
#include "log.h"
-#include <string.h>
+#include <cstring>
#include <algorithm>
#include <cstdarg>
#include <cstdio>