Skip to content

provide recomandations to new implementations on what multibase should be considered baseline #120

@Jorropo

Description

@Jorropo

I recently started working on a new implementation and I wasn't sure if what I think is required as a baseline is consensual, after discussing with a few peoples it seems to be fairly consensual on:

  • f, base16 (upper or not, decoder case insensitive), Hex is easy for monkeys to parse. Almost all apps also already have a hex serializer and decoder included anyway.
  • b, base32 (upper or not, decoder case insensitive), It is a good default because, it is a power of 2 and thus is fast-ish to encode and decode with bit twiddling, it is case insensitive which fits well in the host section of the URI spec (most URI implementations canonicalize hosts to lowercase).
  • k, base36 (upper or not, decoder case insensitive), like base32 it fits in the host URI section, while being more compact, this allows to edge out a few more bytes out of DNS records.
  • z, base58, tbh I don't know why people like it so much but it's used in the wild a lot, would be nice to add a rational or remove it from that list.
  • u, base64url, power of 2, compact and easy to implement while staying ASCII.
  • m, base64, power of 2, sees more use in the wild than base64url but isn't compatible with URLs

We maybe also would want to include:

  • Z, base58flickr
  • v, base32hex
  • h, base32z

Because they can be implemented with alphabet changes of other encodings which you should probably support anyway, which limit codesize and complexity growth.
Edit: never seen them deployed in the wild, the argument still stand, people should implement if they feel the cost is extremely low on them but we don't care to recommend them.


I think it would also be fair to say this is just the decoder list, for the encoder as long as you support any of, base16, base32 or base36 you are good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions