summaryrefslogtreecommitdiff
path: root/rsa/randnum.py
diff options
context:
space:
mode:
authorYesudeep Mangalapilly <yesudeep@gmail.com>2011-08-11 02:38:13 +0530
committerYesudeep Mangalapilly <yesudeep@gmail.com>2011-08-11 02:38:13 +0530
commite97d0d730367ad3b49efc712c01509500939c904 (patch)
treed780c2c3d49075c3c26ce587c17e5b1c9921f5b0 /rsa/randnum.py
parentaed6e8657bc316ccd6964a33c04bd650e9951ae2 (diff)
downloadrsa-git-e97d0d730367ad3b49efc712c01509500939c904.tar.gz
Porting to Python 3 complete. All tests except pyasn1 stuff pass.
Diffstat (limited to 'rsa/randnum.py')
-rw-r--r--rsa/randnum.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rsa/randnum.py b/rsa/randnum.py
index a6a635b..275da0f 100644
--- a/rsa/randnum.py
+++ b/rsa/randnum.py
@@ -21,6 +21,7 @@
import os
from rsa import common, transform
+from rsa._compat import byte
def read_random_bits(nbits):
'''Reads 'nbits' random bits.
@@ -38,7 +39,7 @@ def read_random_bits(nbits):
if rbits > 0:
randomvalue = ord(os.urandom(1))
randomvalue >>= (8 - rbits)
- randomdata = chr(randomvalue) + randomdata
+ randomdata = byte(randomvalue) + randomdata
return randomdata