This is a basic Swift implementation of Recursive Length Prefix Encoding, a serialisation method for encoding arbitrarily structured binary data (byte arrays).
You can read more about it here:
// Encoding Data RLP.encode(_ data: Data) -> Data // Encoding String RLP.encode(_ string: String, with encoding: String.Encoding = .ascii) throws -> Data // Encoding nested array of Data RLP.encode(nestedArrayOfData array: [Any]) throws -> Data // Encoding nested array of String RLP.encode(nestedArrayOfString array: [Any], encodeStringsWith encoding: String.Encoding = .ascii) throws -> Data
RLPSwift is available through CocoaPods.
To install RLPSwift via cocoapods, add the following line to your Podfile:
Swift Package Manager
RLPSwift is available through Swift Package Manager.
Once you have your Swift package set up, adding RLPSwift as a dependency is as easy as adding it to the
dependencies value of your
dependencies: [ .package(url: "https://github.com/bitfwdcommunity/RLPSwift.git", from: "0.0.4") ]