Switch to sha256 as default hashing algorithm.
Add custom ValueError subclasses for finer-grained error reporting.