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

Side by Side Diff: base/sha1_portable.cc

Issue 6410105: run iwyu on base! Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: Created 9 years, 10 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 | « base/scoped_temp_dir.cc ('k') | base/sha2.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "base/sha1.h" 5 #include <stddef.h>
6 #include <string>
6 7
7 #include "base/basictypes.h" 8 #include "base/basictypes.h"
8 9
9 namespace base { 10 namespace base {
10 11
11 // Implementation of SHA-1. Only handles data in byte-sized blocks, 12 // Implementation of SHA-1. Only handles data in byte-sized blocks,
12 // which simplifies the code a fair bit. 13 // which simplifies the code a fair bit.
13 14
14 // Identifier names follow notation in FIPS PUB 180-3, where you'll 15 // Identifier names follow notation in FIPS PUB 180-3, where you'll
15 // also find a description of the algorithm: 16 // also find a description of the algorithm:
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 std::string SHA1HashString(const std::string& str) { 193 std::string SHA1HashString(const std::string& str) {
193 SecureHashAlgorithm sha; 194 SecureHashAlgorithm sha;
194 sha.Update(str.c_str(), str.length()); 195 sha.Update(str.c_str(), str.length());
195 sha.Final(); 196 sha.Final();
196 std::string out(reinterpret_cast<const char*>(sha.Digest()), 197 std::string out(reinterpret_cast<const char*>(sha.Digest()),
197 SecureHashAlgorithm::kDigestSizeBytes); 198 SecureHashAlgorithm::kDigestSizeBytes);
198 return out; 199 return out;
199 } 200 }
200 201
201 } // namespace base 202 } // namespace base
OLDNEW
« no previous file with comments | « base/scoped_temp_dir.cc ('k') | base/sha2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698