- Updated PHPDoc types
- Updated PHPDoc types for encode method
- Added property type declarations
- Replaced HashidsException with InvalidArgumentException
- Removed PHP 7 and 8.0 support
- Renamed Bc class to BCMath
- Added PHP 8.0 support
- Added UTF-8 support (thanks @bonfante)
- Removed PHP 7.1 support
- Added BC and GMP math classes (thanks @jwpage)
- Update and optimize alphabet shuffling (thanks @jwpage)
- Removed PHP 5.0 support (#107)
- Remove ext-bcmath requirement (#91)
- Implemented unhash using Horner's method (thanks @jkramarz)
- Fix bug related to bc math accuracy (thanks @jkramarz)
- Fix bug related to big numbers (thanks @jkramarz)
- Added .editorconfig file
- Added Codecov coverage
- Added StyleCI integration
- Dropped HHVM support
- Dropped PHP 5.3 - 5.5 support
- Updated file structure
- Updated how separators are generated
- Updated test suite
CHANGELOG
moved to its own file (thanks @vinkla).gitattributes
added (thanks @vinkla)- autoload with PSR-4 (thanks @vinkla and @GrahamCampbell)
LICENSE
moved to its own file (thanks @vinkla).gitignore
file simplified (thanks @vinkla)- random
README
cleanups (thanks @vinkla) - applied PSR-1 and PSR-2 to the code (thanks @pablofmorales)
- typo in custom parameters example (thanks @McMillanThomas)
- testing against PHP 7.0 now (thanks @vinkla)
- bug fix for passing empty array to
encode
(thanks @bpahan)
- adjusting examples (thanks @Trismegiste)
- proper version bump in
const VERSION
- PSR-2 cleanup + interface changes (thanks @Trismegiste)
encode()
can accept array of integers (thanks @leunggamciu)
- bug fix for
encode_hex()
(thanks @leihog) - unit test for
encode_hex()/decode_hex()
-
Several public functions are renamed to be more appropriate:
- Function
encrypt()
changed toencode()
- Function
decrypt()
changed todecode()
- Function
encrypt_hex()
changed toencode_hex()
- Function
decrypt_hex()
changed todecode_hex()
Hashids was designed to encode integers, primary ids at most. We've had several requests to encrypt sensitive data with Hashids and this is the wrong algorithm for that. So to encourage more appropriate use,
encrypt/decrypt
is being "downgraded" toencode/decode
. - Function
-
Version tag added:
1.0
-
README.md
updated
- Added encrypt_hex() and decrypt_hex() support
- Minor: Relaxed integer check in encrypt() function (can now pass strings of numbers)
Warning Hashes change in this version
- Bug fix: better handling of big numbers: #3 (thanks @tobsn and @miquelfire)
- Bug fix: exception throwing in constructor
- Default maximum number is set to 1 billion: 1,000,000,000. Unless you have GNU Multiple Precision or BCMath Arbitrary Precision Mathematics library installed - then
PHP_INT_MAX
is used. - Cleanup: private variables use underscores
- General directory cleanup + improvements
- Now only one library file for both PHP 5.3 and PHP 5.4
- Constants uppercased
- Namespace
Hashids
added to library class
Warning Hashes change in this version
- Overall approximately 4x faster
- Consistent shuffle function uses slightly modified version of Fisher–Yates algorithm
- Generate large hash strings faster (more than 1000 chars)
- When using minimum hash length parameter, hash character disorder has been improved
- Basic English curse words will now be avoided even with custom alphabet
- Class name changed from
hashids
toHashids
- New unit tests with PHPUnit (requires latest PHP)
- Composer package at packagist: https://packagist.org/packages/hashids/hashids
- Minor: a bit smaller code overall -- more motivation to port to other languages :P
Warning Hashes change in this version
- Updated default alphabet (thanks to @speps)
- Constructor removes duplicate characters for default alphabet as well (thanks to @speps)
Warning Hashes change in this version
- Minimum hash length can now be specified
- Added more randomness to hashes
- Added unit tests
- Added example files
- Changed warnings that can be thrown
- Renamed
encode/decode
toencrypt/decrypt
- Consistent shuffle does not depend on md5 anymore
- Speed improvements
- Speed improvements
- Bug fixes
- First commit