Skip to content
This repository has been archived by the owner on Feb 2, 2018. It is now read-only.

Write this package #2

Open
jbenet opened this issue Sep 2, 2016 · 0 comments
Open

Write this package #2

jbenet opened this issue Sep 2, 2016 · 0 comments

Comments

@jbenet
Copy link
Member

jbenet commented Sep 2, 2016

It should have types and functions useful to manipulate multicodec-packed.

At least these, but probably other things:

// this represents a varint code that we can use in a table.
type Code []byte // maybe string to allow using it in maps

// some table type that maps a Code to a multicodec path
// so it can be used with the multicodec package.
type Table map[Code]string

func GetCode(buf []byte) Code {} // a way to retrieve the code from a value type.
func AddPrefix(Code, buf []byte) []byte {}  // add a multicodec-packed prefix
func RemovePrefix(buf []byte) []byte {} // remove the multicodec-packed prefix
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant