Skip to content

Commit 6c98231

Browse files
author
Aleph Retamal
committed
Update README.md, bump versions
1 parent 3a3f4e4 commit 6c98231

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

README.md

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
# RLPSwift
22
[![Swift 4.0](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://developer.apple.com/swift/)
33
[![Platforms iOS](https://img.shields.io/badge/Platforms-iOS-lightgray.svg?style=flat)](https://developer.apple.com/swift/)
4-
[![pod v0.0.2](https://img.shields.io/badge/pod-v0.0.2-blue.svg)](https://cocoapods.org)
4+
[![pod v0.0.3](https://img.shields.io/badge/pod-v0.0.3-blue.svg)](https://cocoapods.org)
55

66
This is a basic Swift implementation of Recursive Length Prefix Encoding, a serialisation method for encoding arbitrarily structured binary data (byte arrays).
77

88
You can read more about it here:
99
* [Ethereum Wiki - RLP](https://github.com/ethereum/wiki/wiki/RLP)
1010
* [Ethereum Yellowpaper](https://ethereum.github.io/yellowpaper/paper.pdf) (Appendix B)
1111

12-
# Getting Started
13-
14-
Encoding Strings and nested arrays of String
12+
# Interface
1513

1614
```swift
17-
// Encoding strings
18-
try! RLP.encode("dog") // \u{83}dog
15+
// Encoding Data
16+
RLP.encode(_ data: Data) -> Data
17+
18+
// Encoding String
19+
RLP.encode(_ string: String, with encoding: String.Encoding = .ascii) throws -> Data
20+
21+
// Encoding nested array of Data
22+
RLP.encode(nestedArrayOfData array: [Any]) throws -> Data
1923

20-
// Encoding arrays is just as easy
21-
try! RLP.encode(["cat", "dog"]) // \u{c8}\u{83}cat\u{83}dog
24+
// Encoding nested array of String
25+
RLP.encode(nestedArrayOfString array: [Any], encodeStringsWith encoding: String.Encoding = .ascii) throws -> Data
2226
```
2327

2428
# Installation

RLPSwift.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "RLPSwift"
3-
s.version = "0.0.2"
3+
s.version = "0.0.3"
44
s.license = { :type => "MIT", :file => "LICENSE" }
55
s.homepage = "https://github.com/bitfwdcommunity/RLPSwift"
66
s.author = "Aleph Retamal"

Source/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.0.1</string>
18+
<string>0.0.3</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

0 commit comments

Comments
 (0)