| Index: crypto/sha1.h
|
| diff --git a/crypto/sha1.h b/crypto/sha1.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a8251246fb8c315513fd8ae93534103f8680543c
|
| --- /dev/null
|
| +++ b/crypto/sha1.h
|
| @@ -0,0 +1,34 @@
|
| +// Copyright (c) 2016 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.
|
| +
|
| +#ifndef CRYPTO_SHA1_H_
|
| +#define CRYPTO_SHA1_H_
|
| +
|
| +#include <stddef.h>
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/strings/string_piece.h"
|
| +#include "crypto/crypto_export.h"
|
| +
|
| +namespace crypto {
|
| +
|
| +// These functions perform SHA-1 operations.
|
| +
|
| +static const size_t kSHA1Length = 20; // Length in bytes of a SHA-256 hash.
|
| +
|
| +// Computes the SHA-1 hash of the input string 'str' and stores the first
|
| +// 'len' bytes of the hash in the output buffer 'output'. If 'len' > 32,
|
| +// only 32 bytes (the full hash) are stored in the 'output' buffer.
|
| +CRYPTO_EXPORT void SHA1HashString(const base::StringPiece& str,
|
| + void* output,
|
| + size_t len);
|
| +
|
| +// Convenience version of the above that returns the result in a 32-byte
|
| +// string.
|
| +CRYPTO_EXPORT std::string SHA1HashString(const base::StringPiece& str);
|
| +
|
| +} // namespace crypto
|
| +
|
| +#endif // CRYPTO_SHA1_H_
|
|
|