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

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: Changed to use BlobId and BlobData 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..308a781c4a66fa2533073d61ce1c6969f2f7f616
--- /dev/null
+++ b/blimp/common/blob_cache/sha1_util.h
@@ -0,0 +1,26 @@
+// 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"
+#include "blimp/common/blob_cache/blob_cache.h"
+
+namespace blimp {
+
+// Returns the bytes of a SHA1 hash of the input. The string is guaranteed
+// to have length base::kSHA1Length.
+BLIMP_COMMON_EXPORT BlobId CalculateBlobId(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 FormatBlobId(BlobId& data);
+
+} // namespace blimp
+
+#endif // BLIMP_COMMON_BLOB_CACHE_SHA1_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698