encodetool

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package encodetool provides encoding, decoding, and hashing tools for agents. LLMs cannot natively perform base64 encoding, URL encoding, or cryptographic hashing — this package fills that gap with deterministic, correct transformations.

Problem: Agents frequently need to encode API payloads, decode base64 attachments, URL-encode query parameters, or compute checksums. LLMs cannot perform these operations natively and will hallucinate results.

Supported operations:

  • base64_encode / base64_decode — RFC 4648 standard encoding
  • url_encode / url_decode — RFC 3986 percent-encoding
  • sha256 — SHA-256 cryptographic hash (hex output)

Dependencies:

  • Go stdlib only (crypto/sha256, encoding/base64, net/url)
  • No external system dependencies

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ToolProvider

type ToolProvider struct {
	// contains filtered or unexported fields
}

ToolProvider wraps the encode tool and satisfies the tools.ToolProviders interface.

func NewToolProvider

func NewToolProvider(crypto security.CryptoConfig) *ToolProvider

NewToolProvider creates a ToolProvider for the encode tool. CryptoConfig is passed so the provider shares the same security policy as the rest of the app; weak algorithms (e.g. MD5) are always disabled.

func (*ToolProvider) GetTools

func (p *ToolProvider) GetTools() []tool.Tool

GetTools returns the encode tool.

Jump to

Keyboard shortcuts

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