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

Side by Side Diff: base/md5.h

Issue 211273009: base::MD5IntermediateFinal() generates digest non-destructively. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/md5.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) 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_MD5_H_ 5 #ifndef BASE_MD5_H_
6 #define BASE_MD5_H_ 6 #define BASE_MD5_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 BASE_EXPORT void MD5Init(MD5Context* context); 51 BASE_EXPORT void MD5Init(MD5Context* context);
52 52
53 // For the given buffer of |data| as a StringPiece, updates the given MD5 53 // For the given buffer of |data| as a StringPiece, updates the given MD5
54 // context with the sum of the data. You can call this any number of times 54 // context with the sum of the data. You can call this any number of times
55 // during the computation, except that MD5Init() must have been called first. 55 // during the computation, except that MD5Init() must have been called first.
56 BASE_EXPORT void MD5Update(MD5Context* context, const StringPiece& data); 56 BASE_EXPORT void MD5Update(MD5Context* context, const StringPiece& data);
57 57
58 // Finalizes the MD5 operation and fills the buffer with the digest. 58 // Finalizes the MD5 operation and fills the buffer with the digest.
59 BASE_EXPORT void MD5Final(MD5Digest* digest, MD5Context* context); 59 BASE_EXPORT void MD5Final(MD5Digest* digest, MD5Context* context);
60 60
61 // MD5Final() modifies the context. This clones the context to allow generating
62 // an intermediate digest without affecting the original context.
Ryan Sleevi 2014/03/26 17:49:46 Comment nit: This doesn't really clone (at least,
Scott Hess - ex-Googler 2014/03/27 19:22:34 Yeah, I first had both in a single CL and let the
63 BASE_EXPORT void MD5IntermediateFinal(MD5Digest* digest, MD5Context* context);
64
61 // Converts a digest into human-readable hexadecimal. 65 // Converts a digest into human-readable hexadecimal.
62 BASE_EXPORT std::string MD5DigestToBase16(const MD5Digest& digest); 66 BASE_EXPORT std::string MD5DigestToBase16(const MD5Digest& digest);
63 67
64 // Returns the MD5 (in hexadecimal) of a string. 68 // Returns the MD5 (in hexadecimal) of a string.
65 BASE_EXPORT std::string MD5String(const StringPiece& str); 69 BASE_EXPORT std::string MD5String(const StringPiece& str);
66 70
67 } // namespace base 71 } // namespace base
68 72
69 #endif // BASE_MD5_H_ 73 #endif // BASE_MD5_H_
OLDNEW
« no previous file with comments | « no previous file | base/md5.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698