summaryrefslogtreecommitdiffstats
path: root/chromium/v8/src/utils/hex-format.h
blob: f5b39d1cab03d918b56702258d36f143b50b7e07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_UTILS_HEX_FORMAT_H_
#define V8_UTILS_HEX_FORMAT_H_

#include <stddef.h>
#include <stdint.h>

namespace v8 {
namespace internal {

// Takes a byte array in `val` and formats into a hex-based character array
// contained within `formatted`. `formatted` should be a valid buffer which is
// at least 2x the size of `size_of_val`. Additionally, `size_of_val` should be
// less than 0x20000000. If either of these invariants is violated, a CHECK will
// occur.
void FormatBytesToHex(char* formatted, size_t size_of_formatted,
                      const uint8_t* val, size_t size_of_val);

}  // namespace internal
}  // namespace v8

#endif  // V8_UTILS_HEX_FORMAT_H_