Skip to content

Commit 60ab0f8

Browse files
committed
chore: avoid magic numbers
1 parent 08e15f8 commit 60ab0f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cid.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ func PrefixFromBytes(buf []byte) (Prefix, error) {
603603
}
604604

605605
func CidFromBytes(data []byte) (int, Cid, error) {
606-
if len(data) > 2 && data[0] == 18 && data[1] == 32 {
606+
if len(data) > 2 && data[0] == mh.SHA2_256 && data[1] == 32 {
607607
if len(data) < 34 {
608608
return 0, Undef, fmt.Errorf("not enough bytes for cid v0")
609609
}

0 commit comments

Comments
 (0)