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..6c932398476dd1b58866dacc5c8523518e86a9e7 |
--- /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" |
+#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 const 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(const BlobId& data); |
+ |
+} // namespace blimp |
+ |
+#endif // BLIMP_COMMON_BLOB_CACHE_SHA1_UTIL_H_ |