def numberToBytes(n, howManyBytes=None):    
    if howManyBytes == None:
        howManyBytes = numBytes(n)
    bytes = createByteArrayZeros(howManyBytes)
    for count in range(howManyBytes-1, -1, -1):
        bytes[count] = int(n % 256)
        n >>= 8
    return bytes
Convert an integer into a bytearray, zero-pad to howManyBytes.
dataset/ETHPy150Open splunk/splunk-webframework/contrib/tlslite/tlslite/utils/cryptomath.py/numberToBytes