src/Http/MultipartBody.php
private static function createDefaultBoundary(): string
    {
        try {
            // The following creates a UUID v4
            $string = random_bytes(16);
            $string[6] = chr(ord($string[6]) & 0x0f | 0x40);
            $string[8] = chr(ord($string[8]) & 0x3f | 0x80);

            return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($string), 4));
        } catch (Exception $ex) {
            throw new RuntimeException('Failed to generate random bytes', 0, $ex);
        }
    }
private static function createDefaultBoundary(): string
    {
        try {
            // The following creates a UUID v4
            $string = random_bytes(16);
            $string[6] = chr(ord($string[6]) & 0x0f | 0x40);
            $string[8] = chr(ord($string[8]) & 0x3f | 0x80);

            return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($string), 4));
        } catch (Exception $ex) {
            throw new RuntimeException('Failed to generate random bytes', 0, $ex);
        }
    }
Creates the default boundary in case one wasn't specified

@return string The default boundary
@throws RuntimeException Thrown if random bytes could not be generated