Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Prepend prefix "0" for odd number of hex characters.

chrislusf5c81fa1075b2
diff --git a/go/storage/needle.go b/go/storage/needle.go
index 2a89a2e782..04a9dc78d0 100644
--- a/go/storage/needle.go
+++ b/go/storage/needle.go
@@ -205,6 +205,9 @@ func (n *Needle) ParsePath(fid string) (err 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_len := len(key_hash_bytes)
if khe != nil || key_hash_len <= 4 {