Skip to content

Commit

Permalink
Move deprecated function to there own file.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevina committed Aug 9, 2018
1 parent ad88cb1 commit 67951e2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
23 changes: 0 additions & 23 deletions cid.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,29 +144,6 @@ func NewCidV1(codecType uint64, mhash mh.Multihash) *Cid {
}
}

// 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,
}
}

// Cid represents a self-describing content adressed
// identifier. It is formed by a Version, a Codec (which indicates
// a multicodec-packed content type) and a Multihash.
Expand Down
28 changes: 28 additions & 0 deletions deprecated.go
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,
}
}

0 comments on commit 67951e2

Please sign in to comment.