OLD | NEW |
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 #include "base/sha1.h" | 5 #include "base/sha1.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 void SHA1HashBytes(const unsigned char* data, size_t len, | 208 void SHA1HashBytes(const unsigned char* data, size_t len, |
209 unsigned char* hash) { | 209 unsigned char* hash) { |
210 SecureHashAlgorithm sha; | 210 SecureHashAlgorithm sha; |
211 sha.Update(data, len); | 211 sha.Update(data, len); |
212 sha.Final(); | 212 sha.Final(); |
213 | 213 |
214 memcpy(hash, sha.Digest(), SecureHashAlgorithm::kDigestSizeBytes); | 214 memcpy(hash, sha.Digest(), SecureHashAlgorithm::kDigestSizeBytes); |
215 } | 215 } |
216 | 216 |
217 } // namespace base | 217 } // namespace base |
OLD | NEW |