floor(random() ร (max โ min + 1)) + min
Random integer between 1 and 6: floor(random() ร 6) + 1.
No, it uses standard pseudo-random generation suitable for general-purpose use, not security-sensitive applications.
Yes, both endpoints can be returned.