aboutsummaryrefslogtreecommitdiff
path: root/go/storage/needle.go
diff options
context:
space:
mode:
authorchrislusf <chris.lu@gmail.com>2016-04-08 15:52:03 -0700
committerchrislusf <chris.lu@gmail.com>2016-04-08 15:52:03 -0700
commit5d100994b1b9c6679113c8dd73f97aff85397f02 (patch)
tree8bf46caa1396bbb88d103789b6aadcec709f0dbc /go/storage/needle.go
parenta87fe8ffcec7a5210bf97301e2951eea51a0a0ec (diff)
downloadseaweedfs-5d100994b1b9c6679113c8dd73f97aff85397f02.tar.xz
seaweedfs-5d100994b1b9c6679113c8dd73f97aff85397f02.zip
Revert "Merge pull request #281 from thinxer/binary"
This reverts commit a87fe8ffcec7a5210bf97301e2951eea51a0a0ec, reversing changes made to 6876bfa68524d4fc0a961f89dc29e53fbc654ea5.
Diffstat (limited to 'go/storage/needle.go')
-rw-r--r--go/storage/needle.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/go/storage/needle.go b/go/storage/needle.go
index 6636c342c..e49368820 100644
--- a/go/storage/needle.go
+++ b/go/storage/needle.go
@@ -1,7 +1,6 @@
package storage
import (
- "encoding/binary"
"encoding/hex"
"errors"
"fmt"
@@ -16,6 +15,7 @@ import (
"github.com/chrislusf/seaweedfs/go/glog"
"github.com/chrislusf/seaweedfs/go/images"
"github.com/chrislusf/seaweedfs/go/operation"
+ "github.com/chrislusf/seaweedfs/go/util"
)
const (
@@ -222,7 +222,7 @@ func ParseKeyHash(key_hash_string string) (uint64, uint32, error) {
glog.V(0).Infoln("Invalid key_hash", key_hash_string, "length:", key_hash_len, "error", khe)
return 0, 0, errors.New("Invalid key and hash:" + key_hash_string)
}
- key := binary.BigEndian.Uint64(key_hash_bytes[0 : key_hash_len-4])
- hash := binary.BigEndian.Uint32(key_hash_bytes[key_hash_len-4 : key_hash_len])
+ key := util.BytesToUint64(key_hash_bytes[0 : key_hash_len-4])
+ hash := util.BytesToUint32(key_hash_bytes[key_hash_len-4 : key_hash_len])
return key, hash, nil
}