Swiftpack.co -  tesseract-one/Blake2.swift as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
tesseract-one/Blake2.swift
Swift wrapper for reference C implementation of Blake2b hash
.package(url: "https://github.com/tesseract-one/Blake2.swift.git", from: "0.1.2")

Blake2.swift

🐧 linux: ready GitHub license Build Status GitHub release SPM compatible CocoaPods version Platform macOS | iOS | tvOS | watchOS | Linux

Swift wrapper for reference C implementation of BLAKE2 hash functions.

Installation

Blake2 deploys to macOS, iOS, tvOS, watchOS and Linux. It has been tested on the latest OS releases only however, as the module uses very few platform-provided APIs, there should be very few issues with earlier versions.

Setup instructions:

  • Swift Package Manager: Add this to the dependency section of your Package.swift manifest:

    .package(url: "https://github.com/tesseract-one/Blake2.swift.git", from: "0.1.0")
    
  • CocoaPods: Put this in your Podfile:

    pod 'Blake2', '~> 0.1'
    

Usage Examples

import Blake2

let data = Data("some data for hashing".utf8)

// Simple hash api. 64 byte Blake2b hash.
let hash = try! Blake2.hash(.b2b, size: 64, data: data)
print("Hash", hash)

// Streaming hash api. 64 byte Blake2b hash.
// Create hasher object
var hasher = try! Blake2(.b2b, size: 64)
// insert data by chunks
hasher.update(data)
// and then finalize hasher
let hash2 = try! hasher.finalize()
print("Hash", hash2)

License

Blake2.swift can be used, distributed and modified under the Apache 2.0 license.

GitHub

link
Stars: 0
Last commit: 4 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

Fixed crash on nil key
4 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API