public static function stringToBytes(string $string): int
    {
        $original = trim($string);
        $number = (int)$original;

        if ($number === $original || $number === 0) {
            return $number;
        } else {
            $char = strtoupper(substr($original, -1, 1));
            switch ($char) {
                case 'K': // KILO
                    return $number * 1024;
                    break;

                case 'M': // MEGA
                    return $number * pow(1024, 2);
                    break;

                case 'G': // GIGA
                    return $number * pow(1024, 3);
                    break;

                case 'T': // TERA
                    return $number * pow(1024, 4);
                    break;

                case 'P': // PETA
                    return $number * pow(1024, 5);
                    break;

                case 'E': // EXA
                    return $number * pow(1024, 6);
                    break;

                default:
                    throw new ConvertException('Not implemented sizes greater than exabytes');
                    break;
            }
        }
    }