protected static function validate($guid)
    {
        if (ByteString::strlen($guid) !== 16) {
            return false;
        }

        $byte = $guid[6];
        $byte = (ord($byte) & 0xF0) >> 4;

        if ($byte !== 4) {
            return false;
        }

        $byte = $guid[8];
        $byte = (ord($byte) & 0xC0);

        if ($byte !== 0x80) {
            return false;
        }

        return true;
    }
protected static function validate($guid)
    {
        if (ByteString::strlen($guid) !== 16) {
            return false;
        }

        $byte = $guid[6];
        $byte = (ord($byte) & 0xF0) >> 4;

        if ($byte !== 4) {
            return false;
        }

        $byte = $guid[8];
        $byte = (ord($byte) & 0xC0);

        if ($byte !== 0x80) {
            return false;
        }

        return true;
    }
protected static function validate ( $ guid ) { if ( ByteString :: strlen ( $ guid ) !== 16 ) { return false ; } $ byte = $ guid [ 6 ] ; $ byte = ( ord ( $ byte ) & 0xF0 ) >> 4 ; if ( $ byte !== 4 ) { return false ; } $ byte = $ guid [ 8 ] ; $ byte = ( ord ( $ byte ) & 0xC0 ) ; if ( $ byte !== 0x80 ) { return false ; } return true ; }
Validates the given string is a correct byte stream for a GUID.

This does some seemingly crazy things, but basically it validates that the given value will be within the set
of possible GUID's that GUID::create() can produce.

@param string $guid

@return bool
Validates the given string is a correct byte stream for a GUID .