-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move deprecated function to there own file.
- Loading branch information
Showing
2 changed files
with
28 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package cid | ||
|
||
import ( | ||
mh "github.com/multiformats/go-multihash" | ||
) | ||
|
||
// NewPrefixV0 returns a CIDv0 prefix with the specified multihash type. | ||
// DEPRECATED: Use FormatV0 | ||
func NewPrefixV0(mhType uint64) Prefix { | ||
return Prefix{ | ||
MhType: mhType, | ||
MhLength: mh.DefaultLengths[mhType], | ||
Version: 0, | ||
Codec: DagProtobuf, | ||
} | ||
} | ||
|
||
// NewPrefixV1 returns a CIDv1 prefix with the specified codec and multihash | ||
// type. | ||
// DEPRECATED: Use FormatV1 | ||
func NewPrefixV1(codecType uint64, mhType uint64) Prefix { | ||
return Prefix{ | ||
MhType: mhType, | ||
MhLength: mh.DefaultLengths[mhType], | ||
Version: 1, | ||
Codec: codecType, | ||
} | ||
} |