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

Side by Side Diff: base/sha1.h

Issue 7972024: Update SHA1_LENGTH -> kSHA1Length to match previous change to SHA256_LENGTH. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_SHA1_H_ 5 #ifndef BASE_SHA1_H_
6 #define BASE_SHA1_H_ 6 #define BASE_SHA1_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/base_export.h" 11 #include "base/base_export.h"
12 12
13 namespace base { 13 namespace base {
14 14
15 // This function performs SHA-1 operations. 15 // These functions perform SHA-1 operations.
16 16
17 enum { 17 const size_t kSHA1Length = 20; // Length in bytes of a SHA-1 hash.
wtc 2011/09/24 01:39:41 I asked you this question before but don't remembe
Peter Kasting 2011/09/25 20:52:01 This turns out to be an interesting C-vs.C++-ism.
wtc 2011/09/26 18:06:22 Thank you for the explanation. I didn't know exac
Peter Kasting 2011/09/26 20:08:18 OK. Explicitly saying "static" is probably cleare
18 SHA1_LENGTH = 20 // Length in bytes of a SHA-1 hash.
19 };
20 18
21 // Computes the SHA-1 hash of the input string |str| and returns the full 19 // Computes the SHA-1 hash of the input string |str| and returns the full
22 // hash. 20 // hash.
23 BASE_EXPORT std::string SHA1HashString(const std::string& str); 21 BASE_EXPORT std::string SHA1HashString(const std::string& str);
24 22
25 // Computes the SHA-1 hash of the |len| bytes in |data| and puts the hash 23 // Computes the SHA-1 hash of the |len| bytes in |data| and puts the hash
26 // in |hash|. |hash| must be SHA1_LENGTH bytes long. 24 // in |hash|. |hash| must be kSHA1Length bytes long.
27 BASE_EXPORT void SHA1HashBytes(const unsigned char* data, size_t len, 25 BASE_EXPORT void SHA1HashBytes(const unsigned char* data, size_t len,
28 unsigned char* hash); 26 unsigned char* hash);
29 27
30 } // namespace base 28 } // namespace base
31 29
32 #endif // BASE_SHA1_H_ 30 #endif // BASE_SHA1_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698