Skip to content

Commit 33a4305

Browse files
committed
Move deprecated function to there own file.
1 parent f18b837 commit 33a4305

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

cid.go

-23
Original file line numberDiff line numberDiff line change
@@ -144,29 +144,6 @@ func NewCidV1(codecType uint64, mhash mh.Multihash) *Cid {
144144
}
145145
}
146146

147-
// NewPrefixV0 returns a CIDv0 prefix with the specified multihash type.
148-
// DEPRECATED: Use FormatV0
149-
func NewPrefixV0(mhType uint64) Prefix {
150-
return Prefix{
151-
MhType: mhType,
152-
MhLength: mh.DefaultLengths[mhType],
153-
Version: 0,
154-
Codec: DagProtobuf,
155-
}
156-
}
157-
158-
// NewPrefixV1 returns a CIDv1 prefix with the specified codec and multihash
159-
// type.
160-
// DEPRECATED: Use FormatV1
161-
func NewPrefixV1(codecType uint64, mhType uint64) Prefix {
162-
return Prefix{
163-
MhType: mhType,
164-
MhLength: mh.DefaultLengths[mhType],
165-
Version: 1,
166-
Codec: codecType,
167-
}
168-
}
169-
170147
// Cid represents a self-describing content adressed
171148
// identifier. It is formed by a Version, a Codec (which indicates
172149
// a multicodec-packed content type) and a Multihash.

deprecated.go

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package cid
2+
3+
import (
4+
mh "github.com/multiformats/go-multihash"
5+
)
6+
7+
// NewPrefixV0 returns a CIDv0 prefix with the specified multihash type.
8+
// DEPRECATED: Use FormatV0
9+
func NewPrefixV0(mhType uint64) Prefix {
10+
return Prefix{
11+
MhType: mhType,
12+
MhLength: mh.DefaultLengths[mhType],
13+
Version: 0,
14+
Codec: DagProtobuf,
15+
}
16+
}
17+
18+
// NewPrefixV1 returns a CIDv1 prefix with the specified codec and multihash
19+
// type.
20+
// DEPRECATED: Use FormatV1
21+
func NewPrefixV1(codecType uint64, mhType uint64) Prefix {
22+
return Prefix{
23+
MhType: mhType,
24+
MhLength: mh.DefaultLengths[mhType],
25+
Version: 1,
26+
Codec: codecType,
27+
}
28+
}

0 commit comments

Comments
 (0)