xxHash framework in Swift.

Related tags

Utility xxHash-Swift
Overview

xxHash-Swift

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

Requirements

  • Swift 5.0

Installation

Usage

import xxHash_Swift

Generate one-shot digest

let digest = XXH3.digest64("Input String")

let digest = XXH3.digest64(Data())

Generate digest by streaming

  1. non-async
let digest = try XXH3.digest64 { state in
    for data in dataProducer {
        try state.update(data)
    }
}
return String(digest, radix: 16, uppercase: true)
  1. 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)

Contribution

Update with upstream version

  1. Checkout upstream code with a new version, e.g. v0.8.2
git -C Sources/xxHash/xxHash checkout v0.8.2
  1. Update Sources and Tests if needed
  2. Update README if needed
  3. Tag with a new version accoring to Semantic Versioning 2.0.0

Update Swift Package Tools Version

  1. 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
  1. Update README with Swift requirements
  2. Run test

Add more test according to upstream test data

Test data reference

Add more hash algorithm supported in the upstream

Reference file

License

The library is BSD licensed, which has the same as the upstream.

You might also like...
Merges a given number of PDF files into one file using the PDFKit framework

Titanium iOS PDF Merge Merges a given number of PDF files into one file using the PDFKit framework Requirements iOS 11+ Titanium SDK 9+ API's Methods

A set of utilities (vmcli + vmctl) for macOS Virtualization.framework

VMCLI A set of utilities to help you manage VMs with Virtualization.framework Installation Prerequisites macOS Big Sur (11+) XCode.app installed # mak

SwiftyUpdateKit is a framework for iOS and macOS.
SwiftyUpdateKit is a framework for iOS and macOS.

SwiftyUpdateKit is a framework for iOS and macOS. This framework supports for a user to update your app when new app version is released on the App Store.

Another Virtualization.framework demo project, with focus to iBoot (WIP)
Another Virtualization.framework demo project, with focus to iBoot (WIP)

Virtual iBoot Fun This is just another Virtualization.framework sample project (WIP), but with focus on iBoot (iOS/macOS/tvOS/etc. bootloader) For a m

This iOS framework allows settings to be in-app in addition to or instead of being in the Settings app.
This iOS framework allows settings to be in-app in addition to or instead of being in the Settings app.

InAppSettingsKit InAppSettingsKit (IASK) is an open source framework to easily add in-app settings to your iOS or Catalyst apps. Normally iOS apps use

A framework to provide logic designed to prompt users at the ideal moment for a review of your app/software

ReviewKit ReviewKit is a Swift package/framework that provides logic designed to prompt users at the ideal moment for a review of your app. At a basic

An enhancement built on top of Foundation Framework and XCTest.

Beton is a Swift library built on top of the Foundation framework, that provides an additional layer of functionality, including easy localization, performance test measurement support, and convenience functionality. For us, Beton is primarily, but not exclusively, useful for server-side Swift engineering.

BCSwiftTor - Opinionated pure Swift controller for Tor, including full support for Swift 5.5 and Swift Concurrency

BCSwiftTor Opinionated pure Swift controller for Tor, including full support for

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Comments
  • Update ci.yml

    Update ci.yml

    1. swift build on different archs
    2. use swift test which is faster thanxcodebuild, which is unnecessary because there is no dependencies on Apple Modules

    refer to https://github.com/apple/swift-package-manager/blob/main/Documentation/Usage.md#depending-on-apple-modules

    opened by GitterRemote 0
  • remove xxh_x86dispatch support which cause error on arm devices

    remove xxh_x86dispatch support which cause error on arm devices

    xxh_x86dispatch has only supported on x86_64 etc. devices, so it has to check the arch of the device and import/build the header and source files. This is not easy to do with the current Swift package description manifest, so it is removed from the code.

    opened by GitterRemote 0
  • Fix CI

    Fix CI

    fix ci

    current latest Xcode version of github action is 13, so it doesn't support iOS 16

    Errors:

    package at '/Users/runner/work/xxHash-Swift/xxHash-Swift' is using Swift tools version 5.7.0 but the installed version is 5.5.0
    

    Checkout submodule refer to: https://stackoverflow.com/questions/59271919/how-to-clone-public-submodule-in-github-actions

    opened by GitterRemote 0
Releases(1.0.0)
Owner
Shuaihu
Shuaihu
💻 A fast and flexible O(n) difference algorithm framework for Swift collection.

A fast and flexible O(n) difference algorithm framework for Swift collection. The algorithm is optimized based on the Paul Heckel's algorithm. Made wi

Ryo Aoyama 3.3k Jan 4, 2023
RandomKit is a Swift framework that makes random data generation simple and easy.

RandomKit is a Swift framework that makes random data generation simple and easy. Build Status Installation Compatibility Swift Package Manager CocoaP

Nikolai Vazquez 1.5k Dec 29, 2022
A Swift micro-framework to easily deal with weak references to self inside closures

WeakableSelf Context Closures are one of Swift must-have features, and Swift developers are aware of how tricky they can be when they capture the refe

Vincent Pradeilles 72 Sep 1, 2022
An extensible monitoring framework written in Swift

XestiMonitors Overview Reference Documentation Requirements Installation CocoaPods Carthage Swift Package Manager Usage Core Location Monitors Core Mo

J. G. Pusey 271 Oct 5, 2022
❇️ Feature flagging framework in Swift sauce

RealFlags makes it easy to configure feature flagsin your codebase. It's designed for Swift and provides a simple and elegant abstraction layer over m

Immobiliare Labs 162 Jan 1, 2023
Framework for easily parsing your JSON data directly to Swift object.

Server sends the all JSON data in black and white format i.e. its all strings & we make hard efforts to typecast them into their respective datatypes

Mukesh 11 Oct 17, 2022
Swift 3 framework for accessing data in Event Registry

Swift 3 framework for accessing data in Event Registry

Pavel Pantus 8 Nov 1, 2016
Cereal is a serialization framework built for Swift

Cereal is a serialization framework built for Swift. Its intended as a substitution for NSCoding to allow advanced Swift features. With NSCoding, you cannot encode or decode a Swift struct, enum, or generic class. Cereal solves this issue through deferred decoding with generics, and a protocol that doesn't depend on NSObjectProtocol.

Weebly 369 Sep 28, 2022
Vaccine is a framework that aims to make your apps immune to recompile-disease.

Vaccine Description Vaccine is a framework that aims to make your apps immune to recompile-disease. Vaccine provides a straightforward way to make you

Christoffer Winterkvist 298 Dec 23, 2022