I am using OpenSSL to encode base64 string.
On windows:
echo -n "1" | openssl.exe base64
MQo=
On Debian:
echo -n "1" | openssl base64
MQ==
I get MQo=
from Windows, but MQ==
from linux.
Does anyone know the reason? and which platform generated the right one?
2
Answers
It may not be OS dependent, according to the explanation given below:
Why does a base64 encoded string have an = sign at the end
But the example you’ve provided the data is the same on both OS.
MQo=
means0x31 0x0a
,MQ==
means0x31
. Windowsecho
command does not support-n
argument, reference: windows echo