vinkla / hashids

A small PHP library to generate YouTube-like ids from numbers. Use it when you don't want to expose your database ids to the user.
https://hashids.org/php
MIT License
5.28k stars 418 forks source link

UTF-8 support #128

Closed bonfante closed 5 years ago

bonfante commented 5 years ago

UTF-8 support.

Extension mbstring become required and php ^7.2 to use mb_ord

vinkla commented 5 years ago

Thanks for the pull request @bonfante! Please see my comments.

This pull request is featuring breaking changes and will require a new major release.

@ivanakimov any thoughts?

jd327 commented 5 years ago

@bonfante Thanks for the PR! @vinkla Thanks for the quick follow-up -- I am following your lead on this one!

bonfante commented 5 years ago

@vinkla done 👍.

vinkla commented 5 years ago

Thanks @bonfante! ✨

We'll bump the branch alias to 4.0, please try using the new version in any project. We'll release a new version in a week or two.

jfcherng commented 5 years ago

mb_ord() could be polyfilled thus no need to be PHP72-only actually.

https://github.com/symfony/polyfill-php72/blob/master/Php72.php#L191

vinkla commented 5 years ago

That is great! We’ll probably leave it as it is since 7.1 will reach EOL this year anyway.