calculateSHA256
This allows us to remove a closure, and we also change the code to initialize various constants lazily.