Index: base/sha1.h |
=================================================================== |
--- base/sha1.h (revision 102606) |
+++ base/sha1.h (working copy) |
@@ -12,18 +12,16 @@ |
namespace base { |
-// This function performs SHA-1 operations. |
+// These functions perform SHA-1 operations. |
-enum { |
- SHA1_LENGTH = 20 // Length in bytes of a SHA-1 hash. |
-}; |
+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
|
// Computes the SHA-1 hash of the input string |str| and returns the full |
// hash. |
BASE_EXPORT std::string SHA1HashString(const std::string& str); |
// Computes the SHA-1 hash of the |len| bytes in |data| and puts the hash |
-// in |hash|. |hash| must be SHA1_LENGTH bytes long. |
+// in |hash|. |hash| must be kSHA1Length bytes long. |
BASE_EXPORT void SHA1HashBytes(const unsigned char* data, size_t len, |
unsigned char* hash); |