When getting a bas64 encoded string from the same input string I find that JavaScript, Groovy, and Go have the same result, but GNU base64 is slightly different. Why is that?
JavaScript (nodejs v0.10.33):
new Buffer('Laurence Tureaud is Mr. T').toString('base64');
TGF1cmVuY2UgVHVyZWF1ZCBpcyBNci4gVA==
Groovy (2.3.7 on Java 8):
'Laurence Tureaud is Mr. T'.bytes.encodeBase64().toString()
TGF1cmVuY2UgVHVyZWF1ZCBpcyBNci4gVA==
Go (1.4):
b64.StdEncoding.EncodeToString([]byte("Laurence Tureaud is Mr. T"))
TGF1cmVuY2UgVHVyZWF1ZCBpcyBNci4gVA==
GNU base64 (GNU coreutils 8.12.197-032bb with UTF-8 term charset):
echo 'Laurence Tureaud is Mr. T' | base64
TGF1cmVuY2UgVHVyZWF1ZCBpcyBNci4gVAo=