hash/hashSync: Allow users to specify hash size

See #3.