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


import SHA1

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

Importing SHA1:

To include SHA1 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-sha1.git", from: "1.0.0")


Stars: 0
Last commit: 2 weeks ago

Release Notes

2 weeks ago

👋 hello, sha1!

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