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

Add base58_encode/decode functions #15195

Open
nicolas-grekas opened this issue Aug 1, 2024 · 3 comments
Open

Add base58_encode/decode functions #15195

nicolas-grekas opened this issue Aug 1, 2024 · 3 comments

Comments

@nicolas-grekas
Copy link
Contributor

nicolas-grekas commented Aug 1, 2024

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.

@remicollet
Copy link
Member

Notice that https://pecl.php.net/package/base58 exists
This extensions requires https://github.com/luke-jr/libbase58

@cmb69
Copy link
Member

cmb69 commented Aug 1, 2024

Right, since there is already a PECL package, adding support for base58 encoding/decoding certainly would require the RFC process.

Copy link

There has not been any recent activity in this feature request. It will automatically be closed in 14 days if no further action is taken. Please see https://github.com/probot/stale#is-closing-stale-issues-really-a-good-idea to understand why we auto-close stale feature requests.

@github-actions github-actions bot added the Stale label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants