Shaka Packager SDK
Loading...
Searching...
No Matches
hex_parser.h
1// Copyright 2022 Google LLC. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file or at
5// https://developers.google.com/open-source/licenses/bsd
6
7#ifndef PACKAGER_UTILS_HEX_PARSER_H_
8#define PACKAGER_UTILS_HEX_PARSER_H_
9
10#include <cstdint>
11#include <string>
12#include <vector>
13
14namespace shaka {
15
16// If you use absl::HexStringToBytes directly, any invalid byte sequence will
17// be converted into NUL characters silently. This function will validate the
18// input.
19bool ValidHexStringToBytes(const std::string& hex, std::string* bytes);
20
21// same but output to a vector of uint8_t
22bool ValidHexStringToBytes(const std::string& hex, std::vector<uint8_t>* bytes);
23
24} // namespace shaka
25#endif // PACKAGER_UTILS_HEX_PARSER_H_
All the methods that are virtual are virtual for mocking.