SwiftyHex 1.2.0

SwiftyHex 1.2.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2016
SPMSupports SPM

Maintained by Doug Richardson.



SwiftyHex 1.2.0

  • By
  • Doug Richardson

SwiftyHex

SwiftyHex provides a hexidecimal encoder and decoder.

Usage

Encoding Bytes to String

import SwiftyHex
...
let bytes : [UInt8] = [1,2,3,4,5,6]
let encodedString = SwiftyHex.Encode(bytes)

Decoding String to Bytes

import SwiftyHex
...
let encodedString = "123abc"
let (decodedBytes, ok) = SwiftyHex.Decode(encodedString)
if ok {
    println("Got \(decodedBytes.count) bytes")
} else {
    println("Failed to decode string.")
}