Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to tell what base a string is in. #2

Open
jbenet opened this issue Aug 23, 2016 · 0 comments
Open

Function to tell what base a string is in. #2

jbenet opened this issue Aug 23, 2016 · 0 comments
Labels
help wanted Seeking public contribution on this issue

Comments

@jbenet
Copy link
Member

jbenet commented Aug 23, 2016

Would be great to have:

// StringBase returns the Base s is in.
func StringBase(s string) Base { ... }

// BufferBase returns the Base buf is in.
func BufferBase(buf []byte) Base { ... }

maybe even

type EncodedReader struct {
  R io.Reader // the underlying reader
  B Base // the base the reader is in
}

func NewEncodedReader(r io.Reader) EncodedReader {
  b := consumeTheBaseCode(r)
  return EncodedReader{r, b}
}

func (er *EncodedReader) Decoded() io.Reader {
  // return a reader that returns the decoded data
}
@RichardLitt RichardLitt added the help wanted Seeking public contribution on this issue label Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue
Projects
None yet
Development

No branches or pull requests

2 participants