BitId implementation in PHP