Skip to content

Commit c93dadc

Browse files
committed
Rename the package to SwiftXXHash
1 parent d83e5be commit c93dadc

File tree

13 files changed

+45
-28
lines changed

13 files changed

+45
-28
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Jaesung Jung
3+
Copyright (c) 2025 Jaesung Jung
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

Package.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// swift-tools-version: 6.2
1+
// swift-tools-version: 6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
7-
name: "XXHashKit",
7+
name: "SwiftXXHash",
88
platforms: [
99
.iOS(.v13),
1010
.macCatalyst(.v13),
@@ -15,26 +15,26 @@ let package = Package(
1515
],
1616
products: [
1717
.library(
18-
name: "XXHashKit",
19-
targets: ["XXHashKit"]
18+
name: "XXHash",
19+
targets: ["XXHash"]
2020
),
2121
],
2222
targets: [
2323
.target(
24-
name: "XXHashKit",
25-
dependencies: ["XXHash"]
24+
name: "XXHash",
25+
dependencies: ["libxxhash"]
2626
),
2727
.target(
28-
name: "XXHash",
28+
name: "libxxhash",
2929
sources: ["xxhash.c"],
3030
publicHeadersPath: ".",
3131
cSettings: [
3232
.define("XXH_CPU_LITTLE_ENDIAN")
3333
]
3434
),
3535
.testTarget(
36-
name: "XXHashKitTests",
37-
dependencies: ["XXHashKit"]
36+
name: "SwiftXXHashTests",
37+
dependencies: ["XXHash"]
3838
),
3939
]
4040
)

README.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# XXHashKit
1+
# SwiftXXHash
22

3-
XXHashKit is a Swift wrapper around the official [xxHash](https://github.com/Cyan4973/xxHash) C library, providing **extremely fast hashing** with a clean, idiomatic Swift API.
3+
`SwiftXXHash` is a Swift wrapper around the official [xxHash](https://github.com/Cyan4973/xxHash) C library, providing **extremely fast hashing** with a clean, idiomatic Swift API.
44

55
`xxHash` is an extremely fast non-cryptographic hash algorithm, working at RAM speed limit. It is proposed in four flavors (XXH32, XXH64, XXH3_64bits and XXH3_128bits). The latest variant, XXH3, offers improved performance across the board, especially on small data.
66

@@ -44,7 +44,7 @@ Add this to your `Package.swift`:
4444

4545
```swift
4646
dependencies: [
47-
.package(url: "https://github.com/Jaesung-Jung/XXHashKit.git", from: "1.0.0")
47+
.package(url: "https://github.com/Jaesung-Jung/SwiftXXHash.git", from: "1.0.0")
4848
]
4949
```
5050

@@ -55,7 +55,7 @@ Then add the product to your target:
5555
.target(
5656
name: "YourApp",
5757
dependencies: [
58-
.product(name: "XXHashKit", package: "XXHashKit")
58+
.product(name: "XXHash", package: "SwiftXXHash")
5959
]
6060
)
6161
]
@@ -64,30 +64,46 @@ Then add the product to your target:
6464
## Usage
6565

6666
```swift
67-
import XXHashKit
67+
import XXHash
6868

6969
let data = Data("The quick brown fox jumps over the lazy dog".utf8)
7070

71-
// XXH32
72-
var hasher = XXH32(seed: 1234) // default seed is 0.
71+
// [XXH32]
72+
// - One Shot
73+
let digest = XXH32.hash(data: data)
74+
75+
// - Steam
76+
var hasher = XXH32() // default seed is 0.
7377
hasher.update(data: data)
7478
let digest = Data(hasher.finalize())
7579

76-
// XXH64 with seed
77-
var hasher = XXH64(seed: 1234) // default seed is 0.
80+
// [XXH64]
81+
// - One Shot
82+
let digest = XXH64.hash(data: data)
83+
84+
// - Stream
85+
var hasher = XXH64()
7886
hasher.update(data: data)
7987
let digest = Data(hasher.finalize())
8088

81-
// XXH3 (XXH3-64bit)
82-
var hasher = XXH3(seed: 1234) // default seed is 0.
89+
// [XXH3 (XXH3-64bit)]
90+
// - One Shot
91+
let digest = XXH3.hash(data: data)
92+
93+
// - Stream
94+
var hasher = XXH3()
8395
hasher.update(data: data)
8496
let digest = Data(hasher.finalize())
8597

86-
// XXH128 (XXH3-128bit)
87-
var hasher = XXH128(seed: 1234) // default seed is 0.
98+
// [XXH128 (XXH3-128bit)]
99+
// - One Shot
100+
let digest = XXH3.hash(data: data)
101+
102+
// - Stream
103+
var hasher = XXH128(seed: 1234)
88104
hasher.update(data: data)
89105
let digest = Data(hasher.finalize())
90106
```
91107

92108
## LICENSE
93-
MIT license. See [LICENSE](https://github.com/Jaesung-Jung/XXHashKit/blob/main/LICENSE) for details.
109+
MIT license. See [LICENSE](https://github.com/Jaesung-Jung/SwiftXXHash/blob/main/LICENSE) for details.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24-
import XXHash
24+
import libxxhash
2525

2626
@_exported import protocol CryptoKit.Digest
2727
@_exported import protocol CryptoKit.HashFunction

0 commit comments

Comments
 (0)