aboutsummaryrefslogtreecommitdiff
path: root/weed/util/bytes.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-08-09 21:56:09 -0700
committerChris Lu <chris.lu@gmail.com>2020-08-09 21:56:09 -0700
commite74dc4e4bca245828df180f516973e5d6ac2e1df (patch)
tree00b2251054b30579b64c8f4c75c93329ee72896a /weed/util/bytes.go
parent4f195a54ca5c048a0684f3cf9fadfe0a1fb184c5 (diff)
downloadseaweedfs-e74dc4e4bca245828df180f516973e5d6ac2e1df.tar.xz
seaweedfs-e74dc4e4bca245828df180f516973e5d6ac2e1df.zip
add back fs node cache for renaming
Diffstat (limited to 'weed/util/bytes.go')
-rw-r--r--weed/util/bytes.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/weed/util/bytes.go b/weed/util/bytes.go
index 5076c3e67..890d50586 100644
--- a/weed/util/bytes.go
+++ b/weed/util/bytes.go
@@ -115,9 +115,17 @@ func Base64Encode(data []byte) string {
}
func Base64Md5(data []byte) string {
+ return Base64Encode(Md5(data))
+}
+
+func Md5(data []byte) []byte {
hash := md5.New()
hash.Write(data)
- return Base64Encode(hash.Sum(nil))
+ return hash.Sum(nil)
+}
+
+func Md5String(data []byte) string {
+ return fmt.Sprintf("%x", Md5(data))
}
func Base64Md5ToBytes(contentMd5 string) []byte {