base64

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package base64 provides convenient wrapper functions for base64 encoding and decoding. All functions use the standard base64 encoding (RFC 4648) which is URL-safe and widely compatible across systems.

Example usage:

// Encode a string to base64
encoded := base64.EncodeString("Hello, World!")
fmt.Println(encoded) // SGVsbG8sIFdvcmxkIQ==

// Decode a base64 string
decoded, err := base64.DecodeToString(encoded)
if err != nil {
	log.Fatal(err)
}
fmt.Println(decoded) // Hello, World!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(encoded string) ([]byte, error)

Decode decodes the given base64 string to bytes

func DecodeToString

func DecodeToString(encoded string) (string, error)

DecodeToString decodes the given base64 string to string

func Encode

func Encode(data []byte) string

Encode encodes the given data to base64 string

func EncodeString

func EncodeString(s string) string

EncodeString encodes the given string to base64 string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL