BinUtils
BinUtils copied to clipboard
packing of UInt16 not working
let foo : UInt16 = 0
let d = pack(">H", [ foo ])
print(d)
gives at
case "H":
bytes = UInt16(truncatingBitPattern:o as! Int).data.bytes
Could not cast value of type 'Swift.UInt16' (0x110c130a0) to 'Swift.Int' (0x110c13618).