Created
June 9, 2019 08:43
-
-
Save laevandus/a198f16c215f2ba5736fd0416e8f6a27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let dataPieces = ["The ", "quick ", "brown ", "fox ", "jumps ", "over ", "the ", "lazy ", "dog"].map({ $0.data(using: .utf8)! }) | |
var hasher = SHA512() | |
dataPieces.forEach { (data) in | |
hasher.update(data: data) | |
} | |
print(hasher.finalize()) // 07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment