XU XUv0.16.0

#encoding/base64

import: #encoding/base64

counts: 15 functions, 0 methods, 0 types, 0 constants, 0 method sets

Std plus Raw/URL variants.

encode_to_string

XuAPI
pub fn encode_to_string(s string) string

Purpose

Encode to a string.

Parameters

s string
source string (string)

Returns

string — result string

decode_string

XuAPI
pub fn decode_string(s string) string

Purpose

Decode from a string. Throws on failure; handle the error or propagate it to the caller.

Parameters

s string
source string (string)

Returns

string — result string

encode_url

XuAPI
pub fn encode_url(s string) string

Purpose

Encode url data.

Parameters

s string
source string (string)

Returns

string — result string

encode_raw

XuAPI
pub fn encode_raw(s string) string

Purpose

Encode raw data.

Parameters

s string
source string (string)

Returns

string — result string

encode_raw_url

XuAPI
pub fn encode_raw_url(s string) string

Purpose

Encode raw url data.

Parameters

s string
source string (string)

Returns

string — result string

encoded_len

XuAPI
pub fn encoded_len(n int, pad bool) int

Purpose

Encoded len.

Parameters

n int
count, length, or limit (int)
pad bool
pad (bool)

Returns

int — a value of this type

decoded_len

XuAPI
pub fn decoded_len(n int) int

Purpose

Decoded len.

Parameters

n int
count, length, or limit (int)

Returns

int — a value of this type

decode_url

XuAPI
pub fn decode_url(s string) string

Purpose

Decode url data. Throws on failure; handle the error or propagate it to the caller.

Parameters

s string
source string (string)

Returns

string — result string

decode_raw_url

XuAPI
pub fn decode_raw_url(s string) string

Purpose

Decode raw url data. Throws on failure; handle the error or propagate it to the caller.

Parameters

s string
source string (string)

Returns

string — result string

decode_raw

XuAPI
pub fn decode_raw(s string) string

Purpose

Decode raw data. Throws on failure; handle the error or propagate it to the caller.

Parameters

s string
source string (string)

Returns

string — result string

decode_strict

XuAPI
pub fn decode_strict(s string) string

Purpose

Strict decoders enforce zero trailing padding bits, strip CR/LF before length checks on padded encodings, and reject '=' in raw encodings. Throws on failure; handle the error or propagate it to the caller.

Parameters

s string
source string (string)

Returns

string — result string

decode_url_strict

XuAPI
pub fn decode_url_strict(s string) string

Purpose

Decode url strict data. Throws on failure; handle the error or propagate it to the caller.

Parameters

s string
source string (string)

Returns

string — result string

decode_raw_strict

XuAPI
pub fn decode_raw_strict(s string) string

Purpose

Decode raw strict data. Throws on failure; handle the error or propagate it to the caller.

Parameters

s string
source string (string)

Returns

string — result string

decode_raw_url_strict

XuAPI
pub fn decode_raw_url_strict(s string) string

Purpose

Decode raw url strict data. Throws on failure; handle the error or propagate it to the caller.

Parameters

s string
source string (string)

Returns

string — result string

valid_raw_url

XuAPI
pub fn valid_raw_url(s &string) bool

Purpose

Valid raw url.

Parameters

s &string
source string (read-only borrow; caller keeps the original; type &string)

Returns

bool — true or false