import Foundation public typealias Bytes = Array extension Array where Element == UInt8 { init (count bytes: Int) { self.init(repeating: 0, count: bytes) } public var utf8String: String? { return String(data: Data(self), encoding: .utf8) } } extension ArraySlice where Element == UInt8 { var bytes: Bytes { return Bytes(self) } } public extension String { var bytes: Bytes { return Bytes(self.utf8) } }