diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-05-26 14:08:55 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-05-26 14:08:55 -0700 |
| commit | 955eae3500ef64be7ff4cd33396253d0da333633 (patch) | |
| tree | 404ee823d7ca1e53860711779176f47f737964d0 /weed/filer2/abstract_sql/hashing.go | |
| parent | 2da84ed33115a4f2908479c86442b1936ed1b616 (diff) | |
| download | seaweedfs-955eae3500ef64be7ff4cd33396253d0da333633.tar.xz seaweedfs-955eae3500ef64be7ff4cd33396253d0da333633.zip | |
this works great and support long file names
Diffstat (limited to 'weed/filer2/abstract_sql/hashing.go')
| -rw-r--r-- | weed/filer2/abstract_sql/hashing.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/weed/filer2/abstract_sql/hashing.go b/weed/filer2/abstract_sql/hashing.go new file mode 100644 index 000000000..5e1390233 --- /dev/null +++ b/weed/filer2/abstract_sql/hashing.go @@ -0,0 +1,13 @@ +package abstract_sql + +import ( + "crypto/md5" + "io" +) + +// returns a 128 bit hash +func md5hash(dir string) []byte { + h := md5.New() + io.WriteString(h, dir) + return h.Sum(nil) +} |
