Swift on Linux: CommonCrypto not available
Apple’s CommonCrypto/CommonHMAC.h is not available in Swift on Linux. Previously, I had a function for returning the SHA256 of a string using CommonCrypto:
Since CommonCrypto isn’t available on Linux, I needed a new way to generate SHA256. For my Evolizer server I’m using the Perfect Swift Framework. This framework happens to have extensive cross platform crypto utilities. Using the Perfect libraries my function became: