Skip to content

Commit

Permalink
Export reserved range constants (#53)
Browse files Browse the repository at this point in the history
* Add submodule setup to build instructions
* Export reserved range constants
  • Loading branch information
rvagg committed Jul 23, 2021
1 parent a237c44 commit 52a3ac5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ To generate the constants yourself:

git clone https://github.com/multiformats/go-multicodec
cd go-multicodec
git submodule init && git submodule update
go generate

Note: You may need to install `stringer` via `go install golang.org/x/tools/cmd/stringer`.
Expand Down
8 changes: 8 additions & 0 deletions code.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ var _ flag.Value = (*Code)(nil)
// Assert that Code implements fmt.Stringer without a pointer.
var _ fmt.Stringer = Code(0)

// ReservedStart is the (inclusive) start of the reserved range of codes that
// are safe to use for internal purposes.
const ReservedStart = 0x300000

// ReservedEnd is the (inclusive) end of the reserved range of codes that are
// safe to use for internal purposes.
const ReservedEnd = 0x3FFFFF

// Set implements flag.Value, interpreting the input string as a multicodec and
// setting the receiver to it.
//
Expand Down

0 comments on commit 52a3ac5

Please sign in to comment.