GoodAnalytics.Core.Links.Slug (GoodAnalytics v0.1.1)

Copy Markdown View Source

Slug generation for short links.

Generates random URL-safe slugs or validates custom keys.

Summary

Functions

Generates a random slug of the given length.

Validates a custom key.

Functions

generate(length \\ 7)

Generates a random slug of the given length.

Uses a character set that excludes ambiguous characters (0, O, l, I, 1) for readability.

valid?(key)

Validates a custom key.

Keys must be 1-255 characters, URL-safe (alphanumeric, hyphens, underscores).