Improve Randomness of random verse selection not dependent on system clock.
This commit is contained in:
@@ -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))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user