https://github.com/fromkk/hashkit
HashKit is wrapped C style library CommonCrypt in Swift.
https://github.com/fromkk/hashkit
base64 hash md5 sha1 sha256 swift4
Last synced: about 1 year ago
JSON representation
HashKit is wrapped C style library CommonCrypt in Swift.
- Host: GitHub
- URL: https://github.com/fromkk/hashkit
- Owner: fromkk
- License: mit
- Created: 2016-06-30T06:55:44.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-07-18T22:23:11.000Z (almost 7 years ago)
- Last Synced: 2025-03-27T23:02:43.005Z (about 1 year ago)
- Topics: base64, hash, md5, sha1, sha256, swift4
- Language: Swift
- Homepage:
- Size: 47.9 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://app.bitrise.io/app/6e120dc4d3f844a5)
# HashKit
`HashKit` is wrapped C style library CommonCrypt in Swift.
---
# Install
If you don't have `Cartfile`, should make that file in your top of project.
Add line to `Cartfile`
```
github "fromkk/HashKit" == 1.0.2
```
Execute `carthage update` from command line.
---
# Usage
```swift
import HashKit
//NSData
let data = NSData(...)
print(data.md5())
print(data.sha1())
print(data.sha224())
print(data.sha256())
print(data.sha384())
print(data.sha512())
//String
let text = String(...)
print(text.md5())
print(text.sha1())
print(text.sha224())
print(text.sha256())
print(text.sha384())
print(text.sha512())
//hmac
text.hmac(algorithm: .md5, key: "some key")
```