protected static function truncateHash($hash)
    {
        $offset = ord($hash[19]) & 0xf;
        $value  = (ord($hash[$offset + 0]) & 0x7f) << 24;
        $value |= (ord($hash[$offset + 1]) & 0xff) << 16;
        $value |= (ord($hash[$offset + 2]) & 0xff) << 8;
        $value |= (ord($hash[$offset + 3]) & 0xff);

        return $value;
    }
protected static function truncateHash($hash)
    {
        $offset = ord($hash[19]) & 0xf;
        $value  = (ord($hash[$offset + 0]) & 0x7f) << 24;
        $value |= (ord($hash[$offset + 1]) & 0xff) << 16;
        $value |= (ord($hash[$offset + 2]) & 0xff) << 8;
        $value |= (ord($hash[$offset + 3]) & 0xff);

        return $value;
    }
protected static function truncateHash ( $ hash ) { $ offset = ord ( $ hash [ 19 ] ) & 0xf ; $ value = ( ord ( $ hash [ $ offset + 0 ] ) & 0x7f ) << 24 ; $ value |= ( ord ( $ hash [ $ offset + 1 ] ) & 0xff ) << 16 ; $ value |= ( ord ( $ hash [ $ offset + 2 ] ) & 0xff ) << 8 ; $ value |= ( ord ( $ hash [ $ offset + 3 ] ) & 0xff ) ; return $ value ; }
Extract 4 bytes from a hash value

Uses the method defined in RFC 4226, § 5.4.

@static
@param  string  $hash Hash value.
@return integer Returns the truncated hash value.
Extract 4 bytes from a hash value