Refactor SHA256 digest