An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

[![Build Status](https://app.bitrise.io/app/6e120dc4d3f844a5/status.svg?token=ROncFpKtlUPA1mzZkcBxZQ&branch=master)](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")
```