You can use the built-in CommonCrypto library in Swift to easily generate the SHA256 checksum for raw data. Here's a sample function that takes in raw data in the form of Data type and returns its SHA256 checksum as a hexadecimal string:
main.swift293 chars10 lines
To use this function, simply pass your raw data as a Data object:
main.swift155 chars3 lines
gistlibby LogSnag