X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a4b55a80251d666ca39d0f8d201c70e493b4c661..78700dbcc4f5d34f0a4cfee5c040e716d684ed62:/sdk/go/keepclient/root_sorter.go?ds=sidebyside diff --git a/sdk/go/keepclient/root_sorter.go b/sdk/go/keepclient/root_sorter.go index 7a73d957a0..c2780bc716 100644 --- a/sdk/go/keepclient/root_sorter.go +++ b/sdk/go/keepclient/root_sorter.go @@ -1,8 +1,6 @@ package keepclient import ( - "crypto/md5" - "fmt" "sort" ) @@ -29,14 +27,12 @@ func NewRootSorter(serviceRoots map[string]string, hash string) (*RootSorter) { } func (rs RootSorter) getWeight(hash string, uuid string) (string) { - var service_key []byte if len(uuid) == 27 { - service_key = []byte(hash + uuid[12:]) + return Md5String(hash + uuid[12:]) } else { // Only useful for testing, a set of one service root, etc. - service_key = []byte(hash + uuid) + return Md5String(hash + uuid) } - return fmt.Sprintf("%x", md5.Sum(service_key)) } func (rs RootSorter) GetSortedRoots() ([]string) {