Specify checksum using string or function.

Instead of the strange object with `algorithm` and `size` properties.

Closes #227.