Skip to content

Commit

Permalink
Faster encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Theelx authored Sep 18, 2020
1 parent f4c3145 commit cdc7089
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions base122.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def get7(rawDataLen):
if curIndex >= rawDataLen:
return firstPart
secondByte = rawData[curIndex]
secondPart = (((0xFF00 % 0x100000000) >> curBit) & secondByte) & 0xFF
secondPart >>= 8 - curBit
secondPart = ((((0xFF00 % 0x100000000) >> curBit) & secondByte) & 0xFF) >> (8 - curBit)
return firstPart | secondPart

while True:
Expand Down Expand Up @@ -95,4 +94,4 @@ def push7(byte):

# helper function for people already storing data in base64
def encodeFromBase64(base64str):
return encode(base64.b64decode(base64str))
return encode(base64.b64decode(base64str))

0 comments on commit cdc7089

Please sign in to comment.