Improve Randomness of random verse selection not dependent on system clock.

This commit is contained in:
2022-12-30 22:58:28 +00:00
parent 84e37ba785
commit f92fb7ad30
+2 -2
View File
@@ -56,14 +56,14 @@ def test():
# json # json
@app.get("/random") @app.get("/random")
def random_verse_json(): def random_verse_json():
scripture = random.choice(kjv)['field'] scripture = random.SystemRandom().choice(kjv)['field']
return(respond_json(scripture)) return(respond_json(scripture))
# plain # plain
@app.get("/t/random") @app.get("/t/random")
def random_verse_plain(): def random_verse_plain():
scripture = random.choice(kjv)['field'] scripture = random.SystemRandom().choice(kjv)['field']
return(respond_text(scripture)) return(respond_text(scripture))