aboutsummaryrefslogtreecommitdiff
path: root/rsa/transform.py
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2011-06-20 01:06:39 +0200
committerSybren A. Stüvel <sybren@stuvel.eu>2011-06-20 01:06:39 +0200
commit62abca7fce2b3c4e9b16b43209371bf3c225fb6d (patch)
tree0cea32fbadc8bab97e509d7f095b5564ae810b0e /rsa/transform.py
parent0060065bf34d426bc634ff6dac1ac9475ca4687e (diff)
downloadrsa-62abca7fce2b3c4e9b16b43209371bf3c225fb6d.tar.gz
Added block padding to be able to work with leading zeroes, breaks all kind of stuff
Diffstat (limited to 'rsa/transform.py')
-rw-r--r--rsa/transform.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/rsa/transform.py b/rsa/transform.py
index 9cd1ef3..6719dcb 100644
--- a/rsa/transform.py
+++ b/rsa/transform.py
@@ -12,7 +12,9 @@ def bit_size(number):
return int(math.ceil(math.log(number,2)))
def bytes2int(bytes):
- """Converts a list of bytes or a string to an integer
+ """Converts a list of bytes or an 8-bit string to an integer.
+
+ When using unicode strings, encode it to some encoding like UTF8 first.
>>> (((128 * 256) + 64) * 256) + 15
8405007