Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
fml
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
b
static bool b
Definition
ffi_native_test_module.c:74
result
GAsyncResult * result
Definition
fl_text_input_plugin.cc:106
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
Generated on Fri Apr 26 2024 06:14:05 for Flutter Engine by
1.9.8