Samba is now a mature user of Python and can cope with a
list comprehension from time to time.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
def string_to_byte_array(string):
- blob = [0] * len(string)
-
- for i in range(len(string)):
- blob[i] = string[i] if isinstance(string[i], int) else ord(string[i])
-
- return blob
+ return [c if isinstance(c, int) else ord(c) for c in string]
def arcfour_encrypt(key, data):