diff options
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerUtil.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerUtil.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerUtil.cpp b/llvm/lib/Fuzzer/FuzzerUtil.cpp index d845333a169..579c4f83a87 100644 --- a/llvm/lib/Fuzzer/FuzzerUtil.cpp +++ b/llvm/lib/Fuzzer/FuzzerUtil.cpp @@ -9,7 +9,9 @@ // Misc utils. //===----------------------------------------------------------------------===// +#include "FuzzerUtil.h" #include "FuzzerInternal.h" +#include "FuzzerIO.h" #include <sstream> #include <iomanip> #include <sys/resource.h> @@ -60,19 +62,6 @@ void PrintASCII(const Unit &U, const char *PrintAfter) { PrintASCII(U.data(), U.size(), PrintAfter); } -std::string Sha1ToString(const uint8_t Sha1[kSHA1NumBytes]) { - std::stringstream SS; - for (int i = 0; i < kSHA1NumBytes; i++) - SS << std::hex << std::setfill('0') << std::setw(2) << (unsigned)Sha1[i]; - return SS.str(); -} - -std::string Hash(const Unit &U) { - uint8_t Hash[kSHA1NumBytes]; - ComputeSHA1(U.data(), U.size(), Hash); - return Sha1ToString(Hash); -} - static void AlarmHandler(int, siginfo_t *, void *) { Fuzzer::StaticAlarmCallback(); } |