service

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package service provides token generation services for various formats. Supports UUID, numeric, Luhn-preserving, and alphanumeric token generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenGenerator

type TokenGenerator interface {
	Generate(length int) (string, error)
	Validate(token string) error
}

TokenGenerator defines the interface for token generation.

func NewAlphanumericGenerator

func NewAlphanumericGenerator() TokenGenerator

NewAlphanumericGenerator creates a new alphanumeric token generator. Generates cryptographically secure random alphanumeric tokens using [A-Za-z0-9].

func NewLuhnGenerator

func NewLuhnGenerator() TokenGenerator

NewLuhnGenerator creates a new Luhn algorithm compliant token generator. Generates cryptographically secure random numeric tokens that pass Luhn validation (used for payment cards).

func NewNumericGenerator

func NewNumericGenerator() TokenGenerator

NewNumericGenerator creates a new numeric token generator. Generates cryptographically secure random numeric strings of the specified length.

func NewTokenGenerator

func NewTokenGenerator(formatType tokenizationDomain.FormatType) (TokenGenerator, error)

NewTokenGenerator creates a new token generator based on the specified format type.

func NewUUIDGenerator

func NewUUIDGenerator() TokenGenerator

NewUUIDGenerator creates a new UUID token generator. Generates UUIDv7 tokens.

Jump to

Keyboard shortcuts

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