src/UuidConverter.php
public static function convert(string $uuid)
    {
        // convert to 16 byte binary representation
        $bin = hex2bin(str_replace(['{', '-', '}'], '', $uuid));

        // xor first half with second to give 8 bytes
        $xor = self::xor(...str_split($bin, 8));

        // convert to a 64-bit signed integer
        return unpack('q', $xor)[1];
    }
public static function convert(string $uuid)
    {
        // convert to 16 byte binary representation
        $bin = hex2bin(str_replace(['{', '-', '}'], '', $uuid));

        // xor first half with second to give 8 bytes
        $xor = self::xor(...str_split($bin, 8));

        // convert to a 64-bit signed integer
        return unpack('q', $xor)[1];
    }
public static function convert ( string $ uuid ) { // convert to 16 byte binary representation $ bin = hex2bin ( str_replace ( [ '{' , '-' , '}' ] , '' , $ uuid ) ) ; // xor first half with second to give 8 bytes $ xor = self :: xor ( ... str_split ( $ bin , 8 ) ) ; // convert to a 64-bit signed integer return unpack ( 'q' , $ xor ) [ 1 ] ; }
Convert a uuid to a 64-bit signed integer.

This is a lossy conversion, performed by xoring the both halves.

@param string $uuid

@return int
Convert a uuid to a 64 - bit signed integer .