blob: 478415fc4a1b79961d001f4d1880781a85f2385b [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/spdy/platform/impl/spdy_string_utils_impl.h"
#include <string>
#include "starboard/string.h"
namespace spdy {
bool SpdyHexDecodeToUInt32Impl(SpdyStringPiece data, uint32_t* out) {
if (data.empty() || data.size() > 8u)
return false;
// Pad with leading zeros.
std::string data_padded(8u, '0');
SbMemoryCopy(&data_padded[8u - data.size()],, data.size());
return base::HexStringToUInt(data_padded, out);
} // namespace spdy