A Cross-platform Swift package for generating unique, block-based identicon images. Perfect for creating consistent default avatars for your users or any data-driven visual representation.
- Customizable Identicons: Generate unique blocky avatars from various input types (e.g., user IDs, email hashes).
- Pure Swift: Designed to work seamlessly across Swift platforms, including server-side environments like Vapor.
- Lightweight: Minimal dependencies, ensuring a small footprint.
You can add IdenticonKit to your project using Swift Package Manager.
Add the following to your Package.swift file:
dependencies: [
.package(url: "https://github.com/eric-musliner/identicon-kit.git", from: "1.2.0")
]To create an Identicon in svg format
let svg = IdenticonKit.generateSvg(from: "test@example.com")
// Specify larger grid of elements (.xsmall, .small, .medium, .large)
let svg = IdenticonKit.generate(from: "test@example.com", size: .medium)Build or run tests with:
swift build \
-Xcc -I/usr/include/c++/11 \
-Xcc -I/usr/include/x86_64-linux-gnu/c++/11swift test \
-Xcc -I/usr/include/c++/11 \
-Xcc -I/usr/include/x86_64-linux-gnu/c++/11 \
-Xlinker -L/usr/lib/gcc/x86_64-linux-gnu/11








