Skip to content

Commit

Permalink
feat: rename to swift-rlp, SwiftRLP
Browse files Browse the repository at this point in the history
  • Loading branch information
alephao committed Jan 29, 2024
1 parent 4ef8b6f commit a10665a
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: build
build:
swift build \
--target RLPSwift
--target SwiftRLP

.PHONY: test
test:
Expand Down
14 changes: 7 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@
import PackageDescription

let package = Package(
name: "RLPSwift",
name: "SwiftRLP",
platforms: [
.iOS(.v12),
.macOS(.v10_14),
],
products: [
.library(
name: "RLPSwift",
targets: ["RLPSwift"]
name: "SwiftRLP",
targets: ["SwiftRLP"]
),
.executable(name: "cli", targets: ["cli"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.0")
],
targets: [
.target(name: "RLPSwift"),
.target(name: "SwiftRLP"),
.testTarget(
name: "RLPSwiftTests",
dependencies: ["RLPSwift"]
name: "SwiftRLPTests",
dependencies: ["SwiftRLP"]
),
.executableTarget(
name: "cli",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.target(name: "RLPSwift"),
.target(name: "SwiftRLP"),
]
),
]
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RLPSwift
# SwiftRLP
[![Swift 5.9.2](https://img.shields.io/badge/Swift-5.9.2-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![Version](https://img.shields.io/badge/SPM-0.0.6-orange.svg?stlyle=flat)](https://github.com/alephao/RLPSwift/releases/tag/v0.0.6)
[![Version](https://img.shields.io/badge/SPM-0.0.6-orange.svg?stlyle=flat)](https://github.com/alephao/swift-rlp/releases/tag/v0.0.6)

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

Expand All @@ -10,20 +10,28 @@ RLP Encoding is used in Ethereum. You can read more about it here:

## Library Usage

RLPSwift is available through [Swift Package Manager](https://swift.org/package-manager/).
SwiftRLP is available through [Swift Package Manager](https://swift.org/package-manager/).

Adding RLPSwift as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
Adding SwiftRLP as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.

```swift
dependencies: [
.package(url: "https://github.com/alephao/RLPSwift.git", from: "0.0.6")
.package(url: "https://github.com/alephao/swift-rlp.git", from: "0.0.6")
],
targets: [
.target(
name: "MyTarget",
dependencies: [
.product(name: "SwiftRLP", package: "swift-rlp")
]
),
]
```

### Encoding

```swift
import RLPSwift
import SwiftRLP

let encoder = RLPEncoder()

Expand All @@ -38,7 +46,7 @@ try encoder.encode(.array(["d", "o", "g"]))
### Decoding

```swift
import RLPSwift
import SwiftRLP

let encodedData = try RLPEncoder().encode(string: "dog")

Expand Down Expand Up @@ -66,4 +74,4 @@ $ swift run cli decode 0x83646F67

## License

RLPSwift is released under an [MIT](https://tldrlegal.com/license/mit-license) license. See [LICENSE](LICENSE) for more information.
SwiftRLP is released under an [MIT](https://tldrlegal.com/license/mit-license) license. See [LICENSE](LICENSE) for more information.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Sources/cli/RLPCli.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ArgumentParser
import Foundation
import RLPSwift
import SwiftRLP

@main
struct RLPCli: ParsableCommand {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest

@testable import RLPSwift
@testable import SwiftRLP

class DecodingTests: XCTestCase {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest

@testable import RLPSwift
@testable import SwiftRLP

class EncodingTests: XCTestCase {}

Expand Down

0 comments on commit a10665a

Please sign in to comment.