Skip to content

Commit bebb2a1

Browse files
committed
Per request added comment to explain transform encoding
1 parent 850cf16 commit bebb2a1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pynuodb/crypt.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,14 @@ def __init__(self, key):
280280
state[i], state[j] = state[j], state[i]
281281

282282
def transform(self, data):
283+
"""
284+
Preforms a byte by byte RC4 transform on the stream
285+
Python 2:
286+
automatically handles encoding bytes into an extended ASCII encoding [0,255] w/ 1 byte per character
287+
Python 3:
288+
bytes objects must be converted into extended ASCII, latin-1 uses the desired range of [0,255]
289+
For unicode strings (characters consisting of more than 1 byte) the values are broken into 1 byte sections and shifted
290+
"""
283291
transformed = []
284292
state = self.__state
285293
if type(data) is bytes:

0 commit comments

Comments
 (0)