0-dependency ENSIP-15 in Swift
- Reference Implementation: adraffy/ens-normalize.js
- Unicode:
17.0.0 - Spec Hash:
4febc8f5d285cbf80d2320fb0c1777ac25e378eb72910c34ec963d0a4e319c84
- Unicode:
- ✅️ Passes 100% ENSIP-15 Validation Tests
- ✅️ Passes 100% Unicode Normalization Tests
import ENSNormalize
ENSIP15.shared // Main Library (global instance)Primary API ENSIP15
// String -> String
// throws on invalid names
try "RaFFY🚴♂️.eTh".ensNormalized() // "raffy🚴♂.eth"
// works like ensNormalized()
try "1⃣2⃣.eth".ensBeautified() // "1️⃣2️⃣.eth"- Group —
.groups: [Group] - EmojiSequence —
.emojis: [EmojiSequence] - Whole —
.wholes: [Whole]
All errors are safe to print. NormError is the error enum.
Unicode Normalization Forms
import ENSNormalize
// [Cp] -> [Cp]
ENSIP15.shared.nf.C([0x65, 0x300]) // [0xE8]
ENSIP15.shared.nf.D([0xE8]) // [0x65, 0x300]- Sync and Compress
swift testswift build