I wouldn't assume there's a linefeed.  You ignore trailing characters for sha1sum; why not for base64 as well?