encoding

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeGob added in v0.7.1

func DecodeGob(data []byte, result any) error

DecodeGob decodes a GOB byte slice into the provided result pointer.

func DecodeJson added in v0.7.1

func DecodeJson(value string, result any) error

DecodeJson decodes a JSON string into the provided result pointer.

func DecodeXml added in v0.7.1

func DecodeXml(value string, result any) error

DecodeXml decodes an XML string into the provided result pointer.

func FromBase64

func FromBase64(s string) ([]byte, error)

FromBase64 decodes a base64 string to binary data using standard encoding.

func FromBase64Url added in v0.7.1

func FromBase64Url(s string) ([]byte, error)

FromBase64Url decodes a base64 URL-safe string to binary data.

func FromGob added in v0.7.1

func FromGob[T any](data []byte) (*T, error)

FromGob converts a GOB byte slice to a struct value.

func FromHex

func FromHex(s string) ([]byte, error)

FromHex decodes a hexadecimal string to binary data.

func FromJson added in v0.7.1

func FromJson[T any](value string) (*T, error)

FromJson converts a JSON string to a struct value.

func FromXml added in v0.7.1

func FromXml[T any](value string) (*T, error)

FromXml converts an XML string to a struct value.

func ToBase64

func ToBase64(data []byte) string

ToBase64 encodes binary data to a base64 string using standard encoding.

func ToBase64Url added in v0.7.1

func ToBase64Url(data []byte) string

ToBase64Url encodes binary data to a base64 URL-safe string.

func ToGob added in v0.7.1

func ToGob(value any) ([]byte, error)

ToGob converts a struct value to a GOB byte slice.

func ToHex

func ToHex(data []byte) string

ToHex encodes binary data to a hexadecimal string.

func ToJson added in v0.7.1

func ToJson(value any) (string, error)

ToJson converts a struct value to a JSON string.

func ToXml added in v0.7.1

func ToXml(value any) (string, error)

ToXml converts a struct value to an XML string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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