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

Unified Diff: blimp/common/blob_cache/sha1_util.h

Issue 1867653002: Initial version of Blimp BlobCache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed all comments. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: blimp/common/blob_cache/sha1_util.h
diff --git a/blimp/common/blob_cache/sha1_util.h b/blimp/common/blob_cache/sha1_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..5705893f6cc452a436eda4090be23fb2f9ce4d94
--- /dev/null
+++ b/blimp/common/blob_cache/sha1_util.h
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BLIMP_COMMON_BLOB_CACHE_SHA1_UTIL_H_
+#define BLIMP_COMMON_BLOB_CACHE_SHA1_UTIL_H_
+
+#include <string>
+#include <vector>
+
+#include "blimp/common/blimp_common_export.h"
+
+namespace blimp {
+
+// Returns the bytes of a SHA1 hash of the input. The vector is guaranteed
+// to have length base::kSHA1Length.
+BLIMP_COMMON_EXPORT std::vector<unsigned char> ToSHA1HashBytes(
+ const void* data,
+ size_t data_size);
+
+// Returns a hexadecimal string representation of a SHA1 hash. The input is
+// required to have length base::kSHA1Length.
+BLIMP_COMMON_EXPORT const std::string ToSHA1HexString(const void* data);
Kevin M 2016/04/14 20:08:30 It's hard to distinguish this -- which doesn't has
nyquist 2016/04/15 01:27:12 Agreed. Done.
+
+} // namespace blimp
+
+#endif // BLIMP_COMMON_BLOB_CACHE_SHA1_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698