b64

package
v3.0.0-rc Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

base64 - a package that provides comfortable to use wrappers around existing "encoding/base64".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64

func Base64[T string | []byte](value T) string

Base64 converts provided string or bytes value into base64 string. It's a wrapper around existing "base64.StdEncoding.EncodeToString([]byte(...))". Created to simplify work with base64 and provide convenient template function for "templatex".

func Base64Runtime

func Base64Runtime(value any) string

func Bytes

func Bytes(b64string string) []byte

Bytes converts the given base64 string to a bytes value. Should be used in a known environment, when values are expected to be correct. Panics in case of failure. It's a wrapper around existing "base64.StdEncoding.DecodeString(...)". Created to simplify work with base64.

func String

func String(b64string string) string

String converts the given base64 string to a string value. Should be used in a known environment, when values are expected to be correct. Panics in case of failure. It's a wrapper around existing "base64.StdEncoding.DecodeString(...)". Created to simplify work with base64 and provide convenient template function for "templatex".

Types

This section is empty.

Jump to

Keyboard shortcuts

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