use string instead of []byte as underlying store
This commit is contained in:
committed by
Kevin Atkinson
parent
e153340e5a
commit
92496b5494
@@ -36,7 +36,7 @@ func (p Prefix) WithCodec(c uint64) Builder {
|
||||
func (p V0Builder) Sum(data []byte) (Cid, error) {
|
||||
hash, err := mh.Sum(data, mh.SHA2_256, -1)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return EmptyCid, err
|
||||
}
|
||||
return NewCidV0(hash), nil
|
||||
}
|
||||
@@ -59,7 +59,7 @@ func (p V1Builder) Sum(data []byte) (Cid, error) {
|
||||
}
|
||||
hash, err := mh.Sum(data, p.MhType, mhLen)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return EmptyCid, err
|
||||
}
|
||||
return NewCidV1(p.Codec, hash), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user