Cryptography in swift
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Sources
Tests
.gitignore
LICENSE
Package.swift
README.md

README.md

Crypto

Cryptography in Swift

Package.swift

.package(url: "https://github.com/tris-foundation/crypto.git", from: "master")

SHA1

var sha1 = SHA1()
sha1.update(bytes)
let hash = sha1.final()

Convert to Array or String

_ = [UInt8](hash)
_ = String(hash)

Convenience extensions

let hash = bytes.sha1()

UUID

_ = UUID().uuidStirng
_ = UUID(uuidStirng: "96888CEE-9705-490D-E38A-B407C8A9DA65")

Acknowledgments

The current implementation of SHA1 was ported from OpenSSL