Make addDataPadding method to avoid clutter. #668
|
@ -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