Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 887 Bytes

README.md

File metadata and controls

39 lines (28 loc) · 887 Bytes

Hex

Package.swift

.package(url: "https://github.com/swiftstack/radix.git", .branch("dev"))

Usage

Hex

"c001" == String(encodingToHex: [192, 1])
"C001" == String(encodingToHex: [192, 1], format: .uppercase)
"[0xc0, 0x01]" == String(encodingToHex: [192, 1], format: .array)
"[0xC0, 0x01]" == String(encodingToHex: [192, 1], format: [.uppercase, .array])

_ = [UInt8](decodingHex: "c001")
_ = [UInt8](decodingHex: "C001")

Base64

_ = String(encodingToBase64: "string")
_ = String(encodingToBase64: [UInt8]("or bytes".utf8))

_ = String(decodingBase64: "c3RyaW5n")
_ = String(decodingBase64: [UInt8]("b3IgYnl0ZXM=".utf8))
_ = [UInt8](encodingToBase64: "string")
_ = [UInt8](encodingToBase64: [UInt8]("or bytes".utf8))

_ = [UInt8](decodingBase64: "c3RyaW5n")
_ = [UInt8](decodingBase64: [UInt8]("b3IgYnl0ZXM=".utf8))