A pure Swift implementation of MD5
BSD-3-CLAUSE License
SwiftMD5 is a pure Swift implementation for the MD5 algorithm.
import SwiftMD5
"The quick brown fox jumps over the lazy dog".md5
// "9e107d9d372bb6826bd81d3542a419d6"
let bytes = [Byte]("The quick brown fox jumps over the lazy dog".utf8)
// md5 outputs a 16-byte digest
let encodedBytes: [Byte] = md5(bytes)
// [158, 16, 125, 157, 55, 43, 182, 130, 107, 216, 29, 53, 66, 164, 25, 214]
// Each byte would normally be encoded to a padded hexadecimal in a string
// 9e107d9d372bb6826bd81d3542a419d6
To add SwiftMD5 to your application:
Using Carthage
carthage update
Frameworks
Using Git Submodules
git submodule init -i --recursive
SwiftMD5.xcodeproj
into your project tree as a subprojectFrameworks
SwiftMD5 is released under the BSD license.