let bytes = [84,11] // Imperative — 6 lines but more readable var hex = "" for byte in bytes { let format = NSString(format: "%02x", byte) hex = "\(hex)\(format)" } hex // Functionnal - 4 lines but weird bytes.map({ (byte: Int) -> String in return NSString(format: "%02x", byte) }).reduce("", combine: { (hex, byte) -> String in return hex+byte })