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

Side by Side Diff: base/sha1.h

Issue 6661025: Add base::SHA1HashBytes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually, base/sha1_win.cc is not used, so don't touch it Created 9 years, 9 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
« no previous file with comments | « no previous file | base/sha1_portable.cc » ('j') | base/sha1_portable.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 namespace base { 11 namespace base {
12 12
13 // This function performs SHA-1 operations. 13 // This function performs SHA-1 operations.
14 14
15 enum { 15 enum {
16 SHA1_LENGTH = 20 // Length in bytes of a SHA-1 hash. 16 SHA1_LENGTH = 20 // Length in bytes of a SHA-1 hash.
17 }; 17 };
18 18
19 // 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
20 // hash. 20 // hash.
21 std::string SHA1HashString(const std::string& str); 21 std::string SHA1HashString(const std::string& str);
22 22
23 // Computes the SHA-1 hash of the |len| bytes in |data| and puts the hash
24 // in |hash_array|.
25 void SHA1HashBytes(const unsigned char* data, size_t len,
26 unsigned char* hash_array);
wtc 2011/03/11 18:46:15 Nit: |hash_array| can be shortened to |hash|. Ple
hans 2011/03/13 19:48:16 done
27
23 } // namespace base 28 } // namespace base
24 29
25 #endif // BASE_SHA1_H_ 30 #endif // BASE_SHA1_H_
OLDNEW
« no previous file with comments | « no previous file | base/sha1_portable.cc » ('j') | base/sha1_portable.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698