Swift Bit array to Bytes array (UInt8 array)
问题 I have array with bits: var bits: [Bit] and how could I convert it to bytes array: var bytes: [UInt8] For example I have 280 bits and I should have 35 UInt8 in bytes array. I can think of solution where I take 8bits and check if first is true, if second is true and so and sum the results and have value. This I would do for every 8bits in my bits array. But I think this would be bad solution (it would work but with unnecessary calculations). I think there could be faster solution with some