Could someone tell me what Cg==
means, I just know it's related to Base64.
I have searched but I still don't have a correct answer or an idea of what it is, and I don't have much knowledge about base64
Could someone tell me what Cg==
means, I just know it's related to Base64.
I have searched but I still don't have a correct answer or an idea of what it is, and I don't have much knowledge about base64
Cg== is the base64 encode of the new line character in the latest position. So if you want to encode ABC
you will get QUJD
, however if you include a "return character" after ABC
you will get QUJDCg==
.
You can use hexdump
or xxd
to reveal the actual value of the character in hexadecimal. In the case of Cg==
, it's a linefeed (0A
) which can be verified with the following:
❯ echo -n "Cg==" | base64 -d | hexdump -C
00000000 0a |.|
00000001
In my experience Cg==
arises from passing a string (usually credentials) to base64
using echo
(without the -n
switch and thus appending the default newline character at the end) rather than e.g. with printf
.
© 2022 - 2024 — McMap. All rights reserved.
cg==
you get the letterr
– Dogeared