blob: 9906aa59ee9efc2198db88115bcc4b036d202751 [file] [log] [blame]
// Copyright (c) 2018 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 "chromeos/components/nearby/hash_utils_impl.h"
#include "base/md5.h"
#include "base/memory/ptr_util.h"
#include "crypto/sha2.h"
namespace chromeos {
namespace nearby {
HashUtilsImpl::HashUtilsImpl() = default;
HashUtilsImpl::~HashUtilsImpl() = default;
std::unique_ptr<location::nearby::ByteArray> HashUtilsImpl::md5(
const std::string& input) {
std::string md5_result = base::MD5String(input);
return std::make_unique<location::nearby::ByteArray>(,
std::unique_ptr<location::nearby::ByteArray> HashUtilsImpl::sha256(
const std::string& input) {
std::string sha256_result = crypto::SHA256HashString(input);
return std::make_unique<location::nearby::ByteArray>(,
} // namespace nearby
} // namespace chromeos