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

Side by Side Diff: crypto/sha2.cc

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixes comments by eroman Created 9 years, 8 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 | « crypto/sha2.h ('k') | crypto/sha2_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "crypto/sha2.h"
6
7 #include "base/scoped_ptr.h"
8 #include "base/stl_util-inl.h"
9 #include "crypto/secure_hash.h"
10
11 namespace crypto {
12
13 void SHA256HashString(const std::string& str, void* output, size_t len) {
14 scoped_ptr<SecureHash> ctx(SecureHash::Create(SecureHash::SHA256));
15 ctx->Update(str.data(), str.length());
16 ctx->Finish(output, len);
17 }
18
19 std::string SHA256HashString(const std::string& str) {
20 std::string output(SHA256_LENGTH, 0);
21 SHA256HashString(str, string_as_array(&output), output.size());
22 return output;
23 }
24
25 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/sha2.h ('k') | crypto/sha2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698