Skip to content

Cryptography in Swift

License

Notifications You must be signed in to change notification settings

swiftstack/crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto

Cryptography in Swift

Package.swift

.package(url: "https://github.com/swiftstack/crypto.git", from: "dev")

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 implementation of SHA1 was ported from OpenSSL

Releases

No releases published

Packages

No packages published