xxHash framework in Swift. Original xxHash algorithm created by Yann Collet.
Currently only suppport XXH3-64.
It currently points to the upstream v0.8.1
- Swift 5.0
- Using Swift Package Manager
import xxHash_Swift
let digest = XXH3.digest64("Input String")
let digest = XXH3.digest64(Data())
- non-async
let digest = try XXH3.digest64 { state in
for data in dataProducer {
try state.update(data)
}
}
return String(digest, radix: 16, uppercase: true)
- async
let digest = try await XXH3.digest64 { state in
for try await data in dataProducer {
try state.update(data)
}
}
return String(digest, radix: 16, uppercase: true)
- Checkout upstream code with a new version, e.g. v0.8.2
git -C Sources/xxHash/xxHash checkout v0.8.2
- Update Sources and Tests if needed
- Update README if needed
- Tag with a new version accoring to Semantic Versioning 2.0.0
- Update
Package.swift
manifest, according to Setting the Swift Tools Version
For example, if we want to set the tools version to 5.5
swift package tools-version --set 5.5
- Update
README
with Swift requirements - Run test
The library is BSD licensed, which has the same as the upstream.