blob: 377444939dab458a05f0d20580ec3319b9a5e188 [file] [log] [blame]
Fabrice de Gans-Riberi292b0f6b2019-08-05 23:06:161// Copyright 2019 The Chromium 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#ifndef FUCHSIA_BASE_STRING_UTIL_H_
6#define FUCHSIA_BASE_STRING_UTIL_H_
7
8#include <cstdint>
9#include <vector>
10
11#include "base/containers/span.h"
12#include "base/strings/string_piece.h"
13
14namespace cr_fuchsia {
15
16// Creates a byte vector from a string.
17std::vector<uint8_t> StringToBytes(base::StringPiece str);
18
19// Creates a string from a byte vector.
20base::StringPiece BytesAsString(const std::vector<uint8_t>& bytes);
21
22} // namespace cr_fuchsia
23
24#endif // FUCHSIA_BASE_STRING_UTIL_H_