This code is based on code from md5sum (GNU coreutils / textutils).
