encode

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64

func Base64(data []byte) string

Base64 encodes data to standard base64.

func Base64Decode

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

Base64Decode decodes a standard base64 string.

func Base64Raw

func Base64Raw(data []byte) string

Base64Raw encodes data to base64 without padding.

func Base64URL

func Base64URL(data []byte) string

Base64URL encodes data to URL-safe base64.

func Hex

func Hex(data []byte) string

Hex encodes data to a hex string.

func HexDecode

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

HexDecode decodes a hex string.

func JSON added in v0.2.0

func JSON(v any) string

JSON serializes a value to a JSON string.

func ROT13

func ROT13(s string) string

ROT13 applies ROT13 substitution cipher.

func URL

func URL(s string) string

URL percent-encodes a string.

func URLDecode

func URLDecode(s string) (string, error)

URLDecode decodes a percent-encoded string.

func URLPath

func URLPath(s string) string

URLPath encodes a string for use in a URL path segment.

func URLRaw

func URLRaw(s string) string

URLRaw percent-encodes a string preserving RFC 3986 unreserved characters. Unlike url.QueryEscape, it encodes spaces as %20 (not +) and only escapes characters that are not in: A-Z a-z 0-9 - _ . ~

func UTF16LE

func UTF16LE(s string) []byte

UTF16LE encodes a string to UTF-16 Little Endian bytes. Used for PowerShell -EncodedCommand.

func XOR

func XOR(data, key []byte) []byte

XOR applies XOR encryption with a repeating key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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