Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1.             @classmethod
  2.             def genarray (cls, string):
  3.                 int255 = []
  4.                 if cls.type:
  5.                     int10 = int(string, cls.type)
  6.                     while int10 > 255:
  7.                         int255.append(int10 % 255)
  8.                         int10 //= 255
  9.                     int255.append(int10)
  10.                 else:
  11.                     t = 0
  12.                     for char in string:
  13.                         t += ord(char)
  14.                         while t > 255:
  15.                             int255.append(t % 255)
  16.                             t //= 255
  17.                     int255.append(t)
  18.                 return int255
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement