All Projects → daisuke-t-jp → xxHash-Swift

daisuke-t-jp / xxHash-Swift

Licence: MIT license
xxHash framework in Swift.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to xxHash-Swift

XXHash
XXHash - Extremely fast hash algorithm,impl for csharp,can process 11.8 GB/s on modern cpu. impl with net core 2.0 and .net
Stars: ✭ 24 (+9.09%)
Mutual labels:  hash-functions, hash, xxhash
Xxhash
Extremely fast non-cryptographic hash algorithm
Stars: ✭ 5,783 (+26186.36%)
Mutual labels:  hash-functions, hash, xxhash
Java Crypto Utils
Java Cryptographic, Encoding and Hash Utilities
Stars: ✭ 15 (-31.82%)
Mutual labels:  hash-functions, hash, digest
Sica
🦌 Simple Interface Core Animation. Run type-safe animation sequencially or parallelly
Stars: ✭ 980 (+4354.55%)
Mutual labels:  tvos, swift-package-manager
Sablurimageview
You can use blur effect and it's animation easily to call only two methods.
Stars: ✭ 538 (+2345.45%)
Mutual labels:  tvos, swift-package-manager
Guitar
A Cross-Platform String and Regular Expression Library written in Swift.
Stars: ✭ 641 (+2813.64%)
Mutual labels:  tvos, swift-package-manager
Skeletonui
☠️ Elegant skeleton loading animation in SwiftUI and Combine
Stars: ✭ 275 (+1150%)
Mutual labels:  tvos, swift-package-manager
Swiftlinkpreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
Stars: ✭ 1,216 (+5427.27%)
Mutual labels:  tvos, swift-package-manager
Fontblaster
Programmatically load custom fonts into your iOS and tvOS app.
Stars: ✭ 1,000 (+4445.45%)
Mutual labels:  tvos, swift-package-manager
Id3tageditor
🎵🎸A Swift library to read and write ID3 Tag of any mp3 file. Supported ID3 tag version: 2.2, 2.3 and 2.4. Supported platform: iOS, macOS, tvOS, watchOS, Linux Ubuntu. 🎵🎸
Stars: ✭ 101 (+359.09%)
Mutual labels:  tvos, swift-package-manager
Opencombine
Open source implementation of Apple's Combine framework for processing values over time.
Stars: ✭ 2,040 (+9172.73%)
Mutual labels:  tvos, swift-package-manager
Swiftframeworktemplate
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file
Stars: ✭ 527 (+2295.45%)
Mutual labels:  tvos, swift-package-manager
Functionkit
A framework for functional types and operations designed to fit naturally into Swift.
Stars: ✭ 302 (+1272.73%)
Mutual labels:  tvos, swift-package-manager
Queuer
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).
Stars: ✭ 964 (+4281.82%)
Mutual labels:  tvos, swift-package-manager
Web3.swift
A pure swift Ethereum Web3 library
Stars: ✭ 295 (+1240.91%)
Mutual labels:  tvos, swift-package-manager
Waterfallgrid
A waterfall grid layout view for SwiftUI.
Stars: ✭ 1,086 (+4836.36%)
Mutual labels:  tvos, swift-package-manager
Surmagic
🚀 The better way to deal with Binary Frameworks on iOS, Mac Catalyst, tvOS, macOS, and watchOS. Create XCFrameworks with ease.
Stars: ✭ 119 (+440.91%)
Mutual labels:  tvos, swift-package-manager
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (+527.27%)
Mutual labels:  tvos, swift-package-manager
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (+704.55%)
Mutual labels:  tvos, swift-package-manager
Degu
🐭 Degu is debug utility for iOS, tvOS and macOS.
Stars: ✭ 24 (+9.09%)
Mutual labels:  tvos, swift-package-manager


Platform Language Swift%205.0 CocoaPods Carthage compatible SwiftPM compatible Build Status

Introduction

xxHash framework in Swift.
A framework includes XXH32/XXH64/XXH3-64/XXH3-128 functions.

Original xxHash algorithm created by Yann Collet.

Requirements

  • Platforms
    • iOS 10.0+
    • macOS 10.12+
    • tvOS 12.0+
    • Linux
  • Swift 5.0

Installation

Carthage

github "daisuke-t-jp/xxHash-Swift"

CocoaPods

use_frameworks!

target 'target' do
pod 'xxHash-Swift'
end

Usage

Import framework

import xxHash_Swift

XXH32

Generate digest(One-shot)

let digest = XXH32.digest("123456789ABCDEF")
// digest -> 0x576e3cf9

// Using seed.
let digest = XXH32.digest("123456789ABCDEF", seed: 0x7fffffff)
// digest -> 0xa7f06f9d

Generate digest(Streaming)

// Create xxHash instance
let xxh = XXH32() // if using seed, e.g. "XXH32(0x7fffffff)"

// Get data from file
let bundle = Bundle(for: type(of: self))
let path = bundle.path(forResource: "alice29", ofType: "txt")!
let data = NSData(contentsOfFile: path)! as Data

let bufSize = 1024
var index = 0

repeat {
    var lastIndex = index + bufSize
    if lastIndex > data.count {
        lastIndex = index + data.count - index
    }

    let data2 = data[index..<lastIndex]
    xxh.update(data2) // xxHash update

    index += data2.count
    if index >= data.count {
        break
    }
} while(true)

let digest = xxh.digest()
// digest -> 0xafc8e0c2

XXH64

Generate digest(One-shot)

let digest = XXH64.digest("123456789ABCDEF")
// digest -> 0xa66df83f00e9202d

// Using seed.
let digest = XXH64.digest("123456789ABCDEF", seed: 0x000000007fffffff)
// digest -> 0xe8d84202a16e482f

Generate digest(Streaming)

// Create xxHash instance
let xxh = XXH64() // if using seed, e.g. "XXH64(0x000000007fffffff)"

// Get data from file
let bundle = Bundle(for: type(of: self))
let path = bundle.path(forResource: "alice29", ofType: "txt")!
let data = NSData(contentsOfFile: path)! as Data

let bufSize = 1024
var index = 0

repeat {
    var lastIndex = index + bufSize
    if lastIndex > data.count {
        lastIndex = index + data.count - index
    }

    let data2 = data[index..<lastIndex]
    xxh.update(data2) // xxHash update

    index += data2.count
    if index >= data.count {
        break
    }
} while(true)

let digest = xxh.digest()
// digest -> 0x843c2c4ccfbfb749

XXH3-64

Generate digest(One-shot)

let digest = XXH3.digest64("123456789ABCDEF")
// digest -> 0xfb28db77f56706e8

// Using seed.
let digest = XXH3.digest64("123456789ABCDEF", seed: 0x000000007fffffff)
// digest -> 0xced1ef1da8aa95ae

XXH3-128

Generate digest(One-shot)

let digest = XXH3.digest128("123456789ABCDEF")
// digest[0] -> 0x208cfe2ef00d2aaa
// digest[1] -> 0x9b72015eec4abbf3

// Using seed.
let digest = XXH3.digest128("123456789ABCDEF", seed: 0x000000007fffffff)
// digest[0] -> 0x50554db504518e64
// digest[1] -> 0xc8fb00b18f99658c

Demo

There are demos.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].