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.