Simple framework for HMAC encoding in Swift for iOS, tvOS and macOS
You can add framework to your project manually, or ...
add framework using Carthage:
github "lukszar/EasyCrypt"
Below look at examples you can use in your app.
let crypto = EasyCrypt(secret: "mySecretKey", algorithm: .sha256)
let result = crypto.hash("This is very secret text to encrypt")
let otherResult = crypto.hash("This is another secret text to encrypt")
print("result: ", result)
print("otherResult: ", otherResult)
Inside project you can find Playground demo.
This program is a free software. You use it at your own risk. I don't take any responsibility for any damage, loss etc. which is an result of using this software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under condition of adding an info about author of this software (Łukasz Szarkowicz).