summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-04-13 22:49:05 +0300
committerAndreas Kling <kling@serenityos.org>2021-04-14 13:30:10 +0200
commit2ab292f3811e3d1b553e4897ebc192de409d9ab9 (patch)
tree9b4a9b2fe337da7a8177239e3f804623ff984528 /AK
parent2d58549296531819332e106d86dc92dfbf017ea5 (diff)
downloadserenity-2ab292f3811e3d1b553e4897ebc192de409d9ab9.zip
AK: Expose the decode_hex_digit helper
This helper is useful on its own for things like uri encoding/decoding, so this commit exposes it via the AK/Hex header
Diffstat (limited to 'AK')
-rw-r--r--AK/Hex.cpp2
-rw-r--r--AK/Hex.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/AK/Hex.cpp b/AK/Hex.cpp
index e0913392f5..0e3c367bff 100644
--- a/AK/Hex.cpp
+++ b/AK/Hex.cpp
@@ -35,7 +35,7 @@
namespace AK {
-static u8 decode_hex_digit(char digit)
+u8 decode_hex_digit(char digit)
{
if (digit >= '0' && digit <= '9')
return digit - '0';
diff --git a/AK/Hex.h b/AK/Hex.h
index 66503ed41e..2402973904 100644
--- a/AK/Hex.h
+++ b/AK/Hex.h
@@ -33,6 +33,8 @@
namespace AK {
+u8 decode_hex_digit(char);
+
Optional<ByteBuffer> decode_hex(const StringView&);
String encode_hex(ReadonlyBytes);
@@ -40,4 +42,5 @@ String encode_hex(ReadonlyBytes);
}
using AK::decode_hex;
+using AK::decode_hex_digit;
using AK::encode_hex;