code: def pkcs_i2osp(x,xLen):
      
      z = number.long_to_bytes(x)
      padlen = max(0, xLen-len(z))
      return '\x00'*padlen + z
docs: Converts a long (the first parameter) to the associated byte string
      representation of length l (second parameter). Basically, the length
      parameters allow the function to perform the associated padding.
  
      Input : x        nonnegative integer to be converted
              xLen     intended length of the resulting octet string
  
      Output: x        corresponding nonnegative integer
  
      Reverse function is pkcs_os2ip().