Export provisioning sdk
Change-Id: I4d47d80444c9507f84896767dc676112ca11e901
This commit is contained in:
29
common/sha_util.cc
Normal file
29
common/sha_util.cc
Normal file
@@ -0,0 +1,29 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright 2016 Google Inc.
|
||||
//
|
||||
// This software is licensed under the terms defined in the Widevine Master
|
||||
// License Agreement. For a copy of this agreement, please contact
|
||||
// widevine-licensing@google.com.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "common/sha_util.h"
|
||||
|
||||
#include "openssl/sha.h"
|
||||
|
||||
namespace widevine {
|
||||
|
||||
std::string Sha1_Hash(const std::string& message) {
|
||||
return std::string(reinterpret_cast<char*>(
|
||||
SHA1(reinterpret_cast<const uint8_t*>(message.data()),
|
||||
message.size(), nullptr)),
|
||||
SHA_DIGEST_LENGTH);
|
||||
}
|
||||
|
||||
std::string Sha256_Hash(const std::string& message) {
|
||||
return std::string(reinterpret_cast<char*>(
|
||||
SHA256(reinterpret_cast<const uint8_t*>(message.data()),
|
||||
message.size(), nullptr)),
|
||||
SHA256_DIGEST_LENGTH);
|
||||
}
|
||||
|
||||
} // namespace widevine
|
||||
Reference in New Issue
Block a user