Simplify and optimize
This commit is contained in:
parent
53a3d1635a
commit
41ba921626
|
@ -33,10 +33,5 @@ def isHostInPrivateIPRange(host):
|
|||
return True
|
||||
return False
|
||||
|
||||
def addDataPadding(data, desiredMsgLength = 12):
|
||||
if len(data) >= desiredMsgLength:
|
||||
return data
|
||||
padded = data
|
||||
while len(padded) < desiredMsgLength:
|
||||
padded += '\x00'
|
||||
return padded
|
||||
def addDataPadding(data, desiredMsgLength = 12, paddingChar = '\x00'):
|
||||
return data + paddingChar * (desiredMsgLength - len(data))
|
||||
|
|
Reference in New Issue
Block a user