3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class HashUtil { const MULTIPLIER = 44928000; const NORMAL_BASE = 10; const TARGET_BASE = 31; public static function encode($entityId) { return base_convert($entityId ^ self::MULTIPLIER, self::NORMAL_BASE, self::TARGET_BASE); } public static function decode($hash) { return intval($hash, self::TARGET_BASE) ^ self::MULTIPLIER; } } ?>
based on e2f6Y
Output for 5.4.0 - 7.2.0