blob: b3a4ee745d0171db3f1cc7d0e9aae4d4c4784279 [file] [log] [blame]
Steven Moreland46e0da72019-09-05 15:52:02 -07001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#define FUZZ_LOG_TAG "util"
17#include "util.h"
18
19#include <android-base/logging.h>
20
21#include <iomanip>
22#include <sstream>
23
24std::string hexString(const std::vector<uint8_t>& hash) {
25 std::ostringstream s;
26 s << std::hex << std::setfill('0');
27 for (uint8_t i : hash) {
28 s << std::setw(2) << static_cast<int>(i);
29 }
30 return s.str();
31}