Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Effectiveness ¶
Effectiveness computes a score from 0.0 to 1.0 representing how hard it is for a human to visually distinguish the variant from the original domain. Higher values mean the variation is more deceptive and therefore more effective as a typosquat.
The score is a weighted combination of four signals:
- Edit distance (40%): fewer edits = harder to spot.
- Length ratio (20%): same-length domains are harder to distinguish.
- Visual similarity (30%): changes involving visually confusable character pairs (rn/m, 0/o, 1/l, vv/w, etc.) are subtler.
- Character class preservation (10%): variants that stay all-alphabetic (no digits or symbols introduced) are subtler.
func Levenshtein ¶
Levenshtein computes the Levenshtein distance between two strings, which is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one into the other.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.