Skip to content

Commit a16fbe8

Browse files
author
Cryptoki
committed
Replace random with secrets.
1 parent b0c9fc6 commit a16fbe8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

passcat/passcat.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import docopt
2020

2121
from . import __version__
22-
from random import SystemRandom
22+
from secrets import choice
2323

2424
_dir = os.path.dirname(os.path.abspath(__file__))
2525

@@ -35,7 +35,7 @@ def generate(words, count):
3535
"""
3636
Generate passphrase.
3737
"""
38-
return ' '.join(SystemRandom().sample(words, count))
38+
return ' '.join(choice(words) for i in range(count))
3939

4040
def main():
4141
args = docopt.docopt(__doc__, version=__version__)

0 commit comments

Comments
 (0)