I need your help to convert this Python script to Swift:
startcmd = b'0s000000000000000000'
data = NSData.dataWithBytes_length_(self.startcmd, len(self.startcmd))
Indeed, I wrote this but I know ... I am wrong:
let bytes : [UInt8] = [ 0x0, 0x73, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ]
let data = Data(bytes:bytes)
Data(bytes)0, ASCII value is0x30same as 48 not0x0let bytes: [UInt8] = [48, 115, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48] String(data: Data(bytes), encoding: .ascii)! // "0s000000000000000000"