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

Side by Side Diff: chrome/browser/sync/util/crypto_helpers.h

Issue 194065: Initial commit of sync engine code to browser/sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixes to gtest include path, reverted syncapi. Created 11 years, 3 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_UTIL_CRYPTO_HELPERS_H_
6 #define CHROME_BROWSER_SYNC_UTIL_CRYPTO_HELPERS_H_
7
8 #include <string>
9 #include <vector>
10
11 // An object to handle calculation of MD5 sums.
12 #include "base/basictypes.h"
13 #include "base/logging.h"
14 #include "base/md5.h"
15 #include "base/port.h"
16 #include "chrome/browser/sync/util/sync_types.h"
17
18 class MD5Calculator {
19 protected:
20 MD5Context context_;
21 std::vector<uint8> bin_digest_;
22
23 void CalcDigest();
24 public:
25 MD5Calculator();
26 ~MD5Calculator() {}
27 void AddData(const uint8* data, int length);
28 void AddData(const char* data, int length) {
29 AddData(reinterpret_cast<const uint8*>(data), length);
30 }
31 PathString GetHexDigest();
32 std::vector<uint8> GetDigest();
33 private:
34 DISALLOW_COPY_AND_ASSIGN(MD5Calculator);
35 };
36
37 void GetRandomBytes(char* output, int output_length);
38 std::string Generate128BitRandomHexString();
39
40 #endif // CHROME_BROWSER_SYNC_UTIL_CRYPTO_HELPERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698