From 2ab292f3811e3d1b553e4897ebc192de409d9ab9 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Tue, 13 Apr 2021 22:49:05 +0300 Subject: [PATCH] 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 --- AK/Hex.cpp | 2 +- AK/Hex.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AK/Hex.cpp b/AK/Hex.cpp index e0913392f5b..0e3c367bff9 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 66503ed41e1..2402973904e 100644 --- a/AK/Hex.h +++ b/AK/Hex.h @@ -33,6 +33,8 @@ namespace AK { +u8 decode_hex_digit(char); + Optional 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;