Flutter Engine
Loading...
Searching...
No Matches
hex_codec.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
flutter/fml/base32.h
"
6
7
#include <cstdint>
// uint8_t
8
#include <string>
9
10
namespace
fml
{
11
12
static
constexpr
char
kEncoding
[] =
"0123456789abcdef"
;
13
14
std::string
HexEncode
(std::string_view
input
) {
15
std::string result;
16
result.reserve(
input
.size() * 2);
17
for
(
char
c :
input
) {
18
uint8_t b =
static_cast<
uint8_t
>
(c);
19
result.push_back(
kEncoding
[b >> 4]);
20
result.push_back(
kEncoding
[b & 0xF]);
21
}
22
return
result;
23
}
24
25
}
// namespace fml
base32.h
input
static int input(yyscan_t yyscanner)
fml
Definition
ascii_trie.cc:9
fml::HexEncode
std::string HexEncode(std::string_view input)
Definition
hex_codec.cc:14
fml::kEncoding
static constexpr char kEncoding[]
Definition
base32.cc:13
fml
hex_codec.cc
Generated on Thu Nov 6 2025 16:11:22 for Flutter Engine by
1.9.8