Javatpoint Logo
Javatpoint Logo

Go Base64 Encoding

we can encode String and url in Go. Go has Encoder which takes byte array and convert into string encoding.

The Decoder takes the encoded value and covert it to the original string.

Go Base64 Example

Output:

value to be encode  JavaTpoint@12345!@#$%^&*()
Encoden value:  SmF2YVRwb2ludEAxMjM0NSFAIyQlXiYqKCk=

Value to be decode  SmF2YVRwb2ludEAxMjM0NSFAIyQlXiYqKCk=Decoded value  Ja-vaTpoint@12345!@#$%^&*()

url to be encode  https://golang.org/ref/spec
Encoded url  aHR0cHM6Ly9nb2xhbmcub3JnL3JlZi9zcGVj
value to be decode  aHR0cHM6Ly9nb2xhbmcub3JnL3JlZi9zcGVj
Decoded value  https://golang.org/ref/spec

Process finished with exit code 0

Next TopicGo Random Number





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA