nodebase64

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package nodebase64 reads base64 text as Node's Buffer.from(text, "base64") does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data string) []byte

Decode mirrors Node's Buffer.from(data, "base64"): it accepts the standard and URL-safe alphabets, skips every other character (whitespace included), stops at the first '=', and decodes a trailing partial quantum of two or three characters to one or two bytes. Node's legacy decoder reads the low byte of each UTF-16 code unit of a two-byte string, so U+0141 reads as 'A' and a character outside the BMP, whose surrogate pair ends in 0x3D or lower bytes of its own, can read as '='. The result is never nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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