示例#1
0
 def long_to_bytes(n, blocksize=0):
     ret = _long_to_bytes(n)
     if blocksize == 0:
         return ret
     else:
         assert len(ret) <= blocksize
         padding = blocksize - len(ret)
         return b'\x00' * padding + ret
示例#2
0
文件: utils.py 项目: joshis1/Python
 def long_to_bytes(n, blocksize=0):
     ret = _long_to_bytes(n)
     if blocksize == 0:
         return ret
     else:
         assert len(ret) <= blocksize
         padding = blocksize - len(ret)
         return b"\x00" * padding + ret
示例#3
0
文件: utils.py 项目: joshis1/Python
 def long_to_bytes(n, blocksize=0):
     return _long_to_bytes(n, blocksize or None)
示例#4
0
 def long_to_bytes(n, blocksize=0):
     return _long_to_bytes(n, blocksize or None)