Skip to content

Instantly share code, notes, and snippets.

@laevandus
Last active Apr 30, 2018
Embed
What would you like to do?
if let someData = "Random string".data(using: .utf8) {
let hash = someData.hash(for: .sha256)
print("hash=\(hash.base64EncodedString()).")
}
// hash=LclzKS0NtZFSuwQF5H2FpTralr75LsjrnE3et2LxkHs=.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment