plugins/base64/base64 library

Base64 encoding/decoding plugin for hihook.

Provides hooks for automatic Base64 transformation of payload values.

Use Cases

  • Encode binary data before storage
  • Decode Base64 strings after retrieval
  • Transport encoding for web APIs

Example Usage

final engine = HiEngine();
Base64Plugin().install(engine);

// With URL-safe encoding
Base64Plugin(urlSafe: true).install(engine);

Classes

Base64Plugin
Base64 Plugin - Automatic encoding/decoding of payload values.

Functions

base64DecodeHook({String uid = 'base64:decode', List<String> events = const ['read', 'get'], HiPhase phase = HiPhase.post, int priority = 0, bool urlSafe = false, bool asString = true}) → HiHook
Creates a Base64 decode hook for read operations.
base64EncodeHook({String uid = 'base64:encode', List<String> events = const ['write', 'put'], HiPhase phase = HiPhase.pre, int priority = 0, bool urlSafe = false}) → HiHook
Creates a Base64 encode hook for write operations.
base64EncodeIfFlaggedHook({String uid = 'base64:encodeIfFlagged', List<String> events = const ['write', 'put'], HiPhase phase = HiPhase.pre, int priority = 0, bool urlSafe = false, String flagKey = 'encode'}) → HiHook
Creates a conditional Base64 encode hook.