public function getNumber($min, $max)
    {
        $min = (int) $min;
        $max = (int) $max;

        if ($min > $max) {
            throw new \InvalidArgumentException('Invalid minimum and maximum value');
        }

        if ($min === $max) {
            return $min;
        }

        $difference = $max - $min;

        if (!is_int($difference)) {
            throw new GeneratorException('Too large difference between minimum and maximum');
        }

        return $min + $this->getByteNumber($difference);
    }