Swiftpack.co -  Package - Alja7dali/swift-sha256
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Alja7dali/swift-sha256
A sha256 implementation in swift
.package(url: "https://github.com/Alja7dali/swift-sha256.git", from: "1.0.0")
This is an implementation of SHA256 hash algorithm.

Example:

import SHA256

/// Hash to SHA256
/// 1. convert string to bytes (utf8 format)
let bytes = "Hello, World!".makeBytes()
/// 2. hash bytes using sha256 digesting algorithm
let hashedBytes = SHA256.hash(bytes)
/// 3. converting bytes back to string
let hashedString = try String(hashedBytes) // "dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f"

Importing SHA256:

To include SHA256 in your project, you need to add the following to the dependencies attribute defined in your Package.swift file.

dependencies: [
  .package(url: "https://github.com/alja7dali/swift-sha256.git", from: "1.0.0")
]

GitHub

link
Stars: 0
Last commit: 2 weeks ago

Release Notes

1.0.0
2 weeks ago

👋 hello, sha256!

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