Skip to content

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

@jbenet

Description

@jbenet

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedSeeking public contribution on this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions