what does it mean, or what is Cg==
Asked Answered
S

3

11

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

Spawn answered 31/10, 2019 at 15:11 Comment(2)
Not sure what you mean, but if you decode cg== you get the letter rDogeared
As you are new to this site, please read stackoverflow.com/help/how-to-ask before posting. Show us what you have tried to help us help you.Mercia
U
18

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==.

Unrivaled answered 13/1, 2020 at 17:6 Comment(0)
E
3

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
Exclamation answered 28/6, 2021 at 3:6 Comment(0)
C
3

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.

Cocteau answered 14/5, 2022 at 11:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.