diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-08-04 15:02:20 +0200 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-08-04 17:05:58 +0200 |
commit | ded036cf988b0cf4b20002d88434282f30762638 (patch) | |
tree | d927a9732226093ffcdf7400808ae45f5b9e6c37 /rsa/randnum.py | |
parent | 65a81053d596c62ad2532c7e0e38e68ef61304bd (diff) | |
download | rsa-git-ded036cf988b0cf4b20002d88434282f30762638.tar.gz |
Removed compatibility code for Python 2.7 and 3.4
Diffstat (limited to 'rsa/randnum.py')
-rw-r--r-- | rsa/randnum.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rsa/randnum.py b/rsa/randnum.py index 310acaa..1f0a4e5 100644 --- a/rsa/randnum.py +++ b/rsa/randnum.py @@ -19,9 +19,9 @@ # Source inspired by code by Yesudeep Mangalapilly <yesudeep@gmail.com> import os +import struct from rsa import common, transform -from rsa._compat import byte def read_random_bits(nbits): @@ -40,7 +40,7 @@ def read_random_bits(nbits): if rbits > 0: randomvalue = ord(os.urandom(1)) randomvalue >>= (8 - rbits) - randomdata = byte(randomvalue) + randomdata + randomdata = struct.pack("B", randomvalue) + randomdata return randomdata |