lib/gcrypt/MD5: move code to util/HexFormat.cxx
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "MD5.hxx"
|
||||
#include "Hash.hxx"
|
||||
#include "util/HexFormat.hxx"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -42,13 +43,5 @@ StringBuffer<33>
|
||||
MD5Hex(ConstBuffer<void> input) noexcept
|
||||
{
|
||||
const auto raw = MD5(input);
|
||||
StringBuffer<33> result;
|
||||
|
||||
char *p = result.data();
|
||||
for (const auto i : raw) {
|
||||
sprintf(p, "%02x", i);
|
||||
p += 2;
|
||||
}
|
||||
|
||||
return result;
|
||||
return HexFormatBuffer<raw.size()>(&raw.front());
|
||||
}
|
||||
|
Reference in New Issue
Block a user