Skip to content

Add base58_encode/decode functions #15195

@nicolas-grekas

Description

@nicolas-grekas

Currently, the base58-encoding has to be implemented in PHP, which is slow compared to native code doing the same.

Base58 encoding produces strings that have desirable characteristics compared to base64:

  • URL friendly (no /+ or -_ to deal with)
  • less confusable characters (no 0Ilo)
  • output of similar size (~73% vs 75%)

This makes it perfect to represent unique identifiers or hashes for example. symfony/uid implements it and my feeling is that it's getting increasingly popular.

Having a native and fast implementation would be nice.

See https://en.wikipedia.org/wiki/Binary-to-text_encoding#Base58 for some more background.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions