mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Prepend prefix "0" for odd number of hex characters.
This commit is contained in:
parent
d47a6701c6
commit
5c81fa1075
|
@ -205,6 +205,9 @@ func (n *Needle) ParsePath(fid string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseKeyHash(key_hash_string string) (uint64, uint32, error) {
|
func ParseKeyHash(key_hash_string string) (uint64, uint32, error) {
|
||||||
|
if len(key_hash_string)%2 == 1 {
|
||||||
|
key_hash_string = "0" + key_hash_string
|
||||||
|
}
|
||||||
key_hash_bytes, khe := hex.DecodeString(key_hash_string)
|
key_hash_bytes, khe := hex.DecodeString(key_hash_string)
|
||||||
key_hash_len := len(key_hash_bytes)
|
key_hash_len := len(key_hash_bytes)
|
||||||
if khe != nil || key_hash_len <= 4 {
|
if khe != nil || key_hash_len <= 4 {
|
||||||
|
|
Loading…
Reference in a new issue