Skip to content

Commit bd80dbe

Browse files
committed
sha1/md5: fix exception safety, remove copy, and own exception message
1 parent a0ce99b commit bd80dbe

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

build/win32/conanfile.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[requires]
22
yajl/2.1.0
3-
pcre2/10.42
4-
libxml2/2.12.6
3+
pcre2/10.47
4+
libxml2/2.15.3
55
lua/5.4.6
6-
libcurl/8.6.0
7-
lmdb/0.9.31
8-
libmaxminddb/1.9.1
9-
dirent/1.24
10-
poco/1.13.3
6+
libcurl/8.19.0
7+
lmdb/0.9.35
8+
libmaxminddb/1.13.3
9+
dirent/1.26
10+
poco/1.15.2
1111

1212
[generators]
1313
CMakeDeps

src/utils/string.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ inline std::string string_to_hex(const std::byte *input, size_t size) {
249249
char *d = a.data();
250250

251251
for (size_t i = 0; i < size; ++i) {
252-
const unsigned char c = std::to_integer<unsigned char>(input[i]);
253-
*d++ = lut[c >> 4];
254-
*d++ = lut[c & 15];
252+
const std::byte b = input[i];
253+
*d++ = lut[std::to_integer<unsigned>(b >> 4)];
254+
*d++ = lut[std::to_integer<unsigned>(b & std::byte{0x0F})];
255255
}
256256

257257
return a;

0 commit comments

Comments
 (0)