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

Side by Side Diff: Source/wtf/SHA1.h

Issue 20300002: Fix trailing whitespace in .cpp, .h, and .idl files (ex. Source/core) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | « Source/wtf/RetainPtr.h ('k') | Source/wtf/StackStats.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // of forcing length() to be the size of the buffer used to create the 52 // of forcing length() to be the size of the buffer used to create the
53 // string, prior to inserting the null terminator earlier in the 53 // string, prior to inserting the null terminator earlier in the
54 // sequence. 54 // sequence.
55 ASSERT(input.length() == strlen(string)); 55 ASSERT(input.length() == strlen(string));
56 addBytes(reinterpret_cast<const uint8_t*>(string), input.length()); 56 addBytes(reinterpret_cast<const uint8_t*>(string), input.length());
57 } 57 }
58 void addBytes(const uint8_t* input, size_t length); 58 void addBytes(const uint8_t* input, size_t length);
59 59
60 // computeHash has a side effect of resetting the state of the object. 60 // computeHash has a side effect of resetting the state of the object.
61 void computeHash(Vector<uint8_t, 20>&); 61 void computeHash(Vector<uint8_t, 20>&);
62 62
63 // Get a hex hash from the digest. Pass a limit less than 40 if you want a s horter digest. 63 // Get a hex hash from the digest. Pass a limit less than 40 if you want a s horter digest.
64 static CString hexDigest(const Vector<uint8_t, 20>&); 64 static CString hexDigest(const Vector<uint8_t, 20>&);
65 65
66 // Compute the hex digest directly. Pass a limit less than 40 if you want a shorter digest. 66 // Compute the hex digest directly. Pass a limit less than 40 if you want a shorter digest.
67 CString computeHexDigest(); 67 CString computeHexDigest();
68 68
69 private: 69 private:
70 void finalize(); 70 void finalize();
71 void processBlock(); 71 void processBlock();
72 void reset(); 72 void reset();
73 73
74 uint8_t m_buffer[64]; 74 uint8_t m_buffer[64];
75 size_t m_cursor; // Number of bytes filled in m_buffer (0-64). 75 size_t m_cursor; // Number of bytes filled in m_buffer (0-64).
76 uint64_t m_totalBytes; // Number of bytes added so far. 76 uint64_t m_totalBytes; // Number of bytes added so far.
77 uint32_t m_hash[5]; 77 uint32_t m_hash[5];
78 }; 78 };
79 79
80 } // namespace WTF 80 } // namespace WTF
81 81
82 using WTF::SHA1; 82 using WTF::SHA1;
83 83
84 #endif // WTF_SHA1_h 84 #endif // WTF_SHA1_h
OLDNEW
« no previous file with comments | « Source/wtf/RetainPtr.h ('k') | Source/wtf/StackStats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698