Skip to content

Commit

Permalink
x.x version to x.x.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Aabbdev committed Feb 15, 2021
1 parent 5309870 commit c89a949
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 51 deletions.
21 changes: 0 additions & 21 deletions python/deserializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,6 @@ def decode_32(self):
value |= (self.buffer[self.position] << 24)
self.position += 4
return value
def decode_48(self):
if self.__VerifyEntrySize(6):
return None
value = None
if sys.byteorder == "big":
value = self.buffer[self.position]
value |= (self.buffer[self.position + 1] << 8)
value |= (self.buffer[self.position + 2] << 16)
value |= (self.buffer[self.position + 3] << 24)
value |= (self.buffer[self.position + 4] << 32)
value |= (self.buffer[self.position + 5] << 40)
else:
value = self.buffer[self.position + 5]
value |= (self.buffer[self.position + 4] << 8)
value |= (self.buffer[self.position + 3] << 16)
value |= (self.buffer[self.position + 2] << 24)
value |= (self.buffer[self.position + 1] << 32)
value |= (self.buffer[self.position] << 40)

self.position += 6
return value
def decode_64(self):
if self.__VerifyEntrySize(8):
return None
Expand Down
29 changes: 0 additions & 29 deletions python/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,35 +63,6 @@ def encode_32(self, value):
self.buffer[self.position + 2] = val[2]
self.buffer[self.position + 3] = val[3]
self.position += 4
def encode_48(self, value):
assert(isinstance(value, int))
assert(value < 0x1000000000000)

val = [0,0,0,0,0,0]
if sys.byteorder == "big":
val[0] = value & 0xff
val[1] = (value >> 8) & 0xFF
val[2] = (value >> 16) & 0xFF
val[3] = (value >> 24) & 0xFF
val[4] = (value >> 32) & 0xFF
val[5] = (value >> 40) & 0xFF
else:
val[5] = value & 0xff
val[4] = (value >> 8) & 0xFF
val[3] = (value >> 16) & 0xFF
val[2] = (value >> 24) & 0xFF
val[1] = (value >> 32) & 0xFF
val[0] = (value >> 40) & 0xFF
if self.__VerifyEntrySize(6):
assert (self.autoResize)
self.buffer += bytes(range((self.position + 6)-len(self.buffer)))
self.buffer[self.position] = val[0]
self.buffer[self.position + 1] = val[1]
self.buffer[self.position + 2] = val[2]
self.buffer[self.position + 3] = val[3]
self.buffer[self.position + 4] = val[4]
self.buffer[self.position + 5] = val[5]
self.position += 6
def encode_64(self, value):
assert(isinstance(value, int))
assert(value < 0x10000000000000000)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup
setup(name='uniserializer',
version='1.26',
version='1.27.0',
description='Fast and efficient universal data serializer',
url='https://github.com/Diffylab/UniSerializer',
author='Diffy',
Expand Down

0 comments on commit c89a949

Please sign in to comment.