def METHOD_NAME(self, first: int, last: int) -> int:
    size = last - first + 1
    if size > 4294967296:
        raise ValueError("too big")
    if size > 65536:
        rand = self.random_32
        max = 4294967295
    elif size > 256:
        rand = self.random_16
        max = 65535
    else:
        rand = self.random_8
        max = 255
    return first + size * rand() // (max + 1)