withUnsafeBytes' is deprecated

Unless I am mistaken, this can be shortened to

var bigNum = Int64(0)
withUnsafeMutableBytes(of: &bigNum) {
  data.copyBytes(to: $0)
}

since copyBytes() limits the number of bytes to copy to the size of the target buffer.

2 Likes