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..fcc1959479c1e0a89e893445919fe8ed6c7d643f |
--- /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 FormatSHA1Hash(const void* data); |
Kevin M
2016/04/15 17:28:51
Take a const std::string& as input.
nyquist
2016/04/16 00:25:30
Done.
|
+ |
+} // namespace blimp |
+ |
+#endif // BLIMP_COMMON_BLOB_CACHE_SHA1_UTIL_H_ |