When doing an echo it gives me this:
MacPro:~ bardiir$ echo 'test'testMacPro:~ bardiir$
I'd guess you might have an included line-ending in the unix one as echo is probably appending a newline character even if you pipe it throuch to the base64 encode.