tidalf/plugin.audio.qobuz

View on GitHub
resources/lib/qobuz/util/random.py

Summary

Maintainability
A
0 mins
Test Coverage
import math
import os


def limitedchaos():
    return ord(os.urandom(1)) / 256.0


def randint():
    return int(math.floor(limitedchaos() * 10 + 1))


def randrange(start=0, end=10):
    return int(math.floor(limitedchaos() * ((end - start) + 1) + start))