static function __static() { $self = new XPClass(__CLASS__); foreach (hash_algos() as $algo) { MessageDigest::register($algo, $self); } // Overwrite crc32b implementation if a buggy implementation is detected. // Workaround for http://bugs.php.net/bug.php?id=45028 if ('0a1cb779' === hash('crc32b', 'AAAAAAAA')) { MessageDigest::register('crc32b', ClassLoader::defineClass(__CLASS__ . '·CRC32bDigestImpl', $self->getName(), array(), '{ public function doFinal() { $n= hexdec(hash_final($this->handle)); return sprintf("%08x", (($n & 0xFF) << 24) + (($n & 0xFF00) << 8) + (($n & 0xFF0000) >> 8) + (($n >> 24) & 0xFF)); } }')); } }
public function registerTestClassAsImplementation() { MessageDigest::register('irrelevant', $this->getClass()); }
static function __static() { MessageDigest::register('crc16', new \lang\XPClass(__CLASS__)); }