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

proposal: encoding/base32: add z-base-32 encoding #18810

Closed
ghost opened this issue Jan 27, 2017 · 3 comments
Closed

proposal: encoding/base32: add z-base-32 encoding #18810

ghost opened this issue Jan 27, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 27, 2017

There is a human oriented version of base32 encoding, namely z-base-32. It would be nice to have it in the standard library.

RATIONALE

The rationale for base-32 encoding in RFC 3548 [1] is as written therein: "The
Base 32 encoding is designed to represent arbitrary sequences of octets in a
form that needs to be case insensitive but need not be humanly readable.".

The rationale for our encoding is different -- it is to represent arbitrary
sequences of octets in a form that is as convenient as possible for human
users to manipulate. In particular, z-base-32 was created in order to serve
the Mnet project [3], where 30-octet cryptographic values are encoded into
URIs for humans to manipulate. Anticipated uses of these URIs include cut-
and-paste, text editing (e.g. in HTML files), manual transcription via a
keyboard, manual transcription via pen-and-paper, vocal transcription over
phone or radio, etc.

The desiderata for such an encoding are:

  • minimizing transcription errors -- e.g. the well-known problem of confusing
    0' with O'
  • embedding into other structures -- e.g. search engines, structured or
    marked-up text, file systems, command shells
  • brevity -- Shorter URLs are better than longer ones.
  • ergonomics -- Human users (especially non-technical ones) should find the
    URIs as easy and pleasant as possible. The uglier the URI looks, the worse.

http://philzimmermann.com/docs/human-oriented-base-32-encoding.txt

@bradfitz bradfitz added this to the Proposal milestone Jan 27, 2017
@bradfitz bradfitz changed the title encoding/base32: add z-base-32 encoding proposal: encoding/base32: add z-base-32 encoding Jan 27, 2017
@rsc
Copy link
Contributor

rsc commented Jan 30, 2017

Is there widespread use of this encoding? I don't see any evidence of that.

Also the encoding seems to worry about encoding bit strings as well as byte strings, and the encoding/base32 package is byte-oriented. I worry that if we add z-base-32 then we'll also have to add more API about bit inputs.

This seems like a great candidate for a third-party package. What's the argument for it being added to the standard library instead? Why is it important?

@cespare
Copy link
Contributor

cespare commented Jan 30, 2017

There is already a fine third-party package for this encoding: https://godoc.org/github.com/tv42/zbase32

@bradfitz
Copy link
Contributor

I think that's fine. I don't think this meets the bar for standard library inclusion (https://golang.org/doc/faq#x_in_std).

Let's revisit this if/when this encoding becomes more widespread.

@golang golang locked and limited conversation to collaborators Jan 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants