utilgo.mau.fi/util/confusable Index | Files

package confusable

import "go.mau.fi/util/confusable"

Package confusable implements confusable detection according to UTS #39.

Index

Functions

func Confusable

func Confusable(x, y string) bool

Confusable checks if two strings are confusable.

func GetReplacement

func GetReplacement(input rune) string

func Skeleton

func Skeleton(input string) string

Skeleton is the skeleton function defined in UTS #39.

If two strings have the same skeleton, they're considered confusable. The skeleton strings are not intended for displaying to users.

See https://www.unicode.org/reports/tr39/#Confusable_Detection for more info.

func SkeletonBytes

func SkeletonBytes(input string) []byte

SkeletonBytes is the same as Skeleton, but it returns the skeleton as a byte slice.

func SkeletonHash

func SkeletonHash(input string) [32]byte

SkeletonHash returns the sha256 hash of the skeleton of the string.

Source Files

confusables.go skeleton.go

Version
v0.8.6 (latest)
Published
Mar 16, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
1 week ago

Tools for package owners.