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

Side by Side Diff: net/base/hash_value.cc

Issue 1158923005: Use the exact-width integer types defined in <stdint.h> rather than (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak comments. Exclude mime_sniffer*. Rebase. Created 5 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/base/hash_value.h" 5 #include "net/base/hash_value.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/sha1.h" 9 #include "base/sha1.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return fingerprint.sha1.data; 105 return fingerprint.sha1.data;
106 case HASH_VALUE_SHA256: 106 case HASH_VALUE_SHA256:
107 return fingerprint.sha256.data; 107 return fingerprint.sha256.data;
108 default: 108 default:
109 NOTREACHED() << "Unknown HashValueTag " << tag; 109 NOTREACHED() << "Unknown HashValueTag " << tag;
110 return NULL; 110 return NULL;
111 } 111 }
112 } 112 }
113 113
114 bool IsSHA1HashInSortedArray(const SHA1HashValue& hash, 114 bool IsSHA1HashInSortedArray(const SHA1HashValue& hash,
115 const uint8* array, 115 const uint8_t* array,
116 size_t array_byte_len) { 116 size_t array_byte_len) {
117 DCHECK_EQ(0u, array_byte_len % base::kSHA1Length); 117 DCHECK_EQ(0u, array_byte_len % base::kSHA1Length);
118 const size_t arraylen = array_byte_len / base::kSHA1Length; 118 const size_t arraylen = array_byte_len / base::kSHA1Length;
119 return NULL != bsearch(hash.data, array, arraylen, base::kSHA1Length, 119 return NULL != bsearch(hash.data, array, arraylen, base::kSHA1Length,
120 CompareSHA1Hashes); 120 CompareSHA1Hashes);
121 } 121 }
122 122
123 } // namespace net 123 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698