hex_to_str

This commit is contained in:
2025-07-21 16:02:15 +03:00
parent ebe6e58ef3
commit be2c4e7792
5 changed files with 16 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
#include "string/str.h"
#include "string/StringBuilder.h"
str str_copy(str src){
if(src.data == NULL || src.size == 0)
@@ -123,3 +124,9 @@ str str_toLower(str src){
}
return r;
}
str hex_to_str(Array buf, bool uppercase){
StringBuilder sb = StringBuilder_alloc(buf.size * 2 + 1);
StringBuilder_append_memory(&sb, buf, uppercase);
return StringBuilder_getStr(&sb);
}