Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(828)

Side by Side Diff: media/cast/test/crypto_utility.cc

Issue 62843002: Cast: Added support for AES-CTR crypto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 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 #include "base/strings/string_number_conversions.h"
6 #include "media/cast/test/crypto_utility.h"
7
8 namespace media {
9 namespace cast {
10
11 std::string ConvertFromBase16String(const std::string base_16) {
12 std::string compressed;
13 DCHECK_EQ(base_16.size() % 2, 0u) << "Must be a multiple of 2";
14 compressed.reserve(base_16.size() / 2);
15
16 std::vector<uint8> v;
17 if (!base::HexStringToBytes(base_16, &v)) {
18 NOTREACHED();
19 }
20 compressed.assign(reinterpret_cast<const char*>(&v[0]), v.size());
21 return compressed;
22 }
23
24 } // namespace cast
25 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698