Swiftpack.co - gaetanomatonti/Uno as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by gaetanomatonti.
gaetanomatonti/Uno 0.4.0
A simple OTP generator written in Swift.
⭐️ 3
🕓 34 weeks ago
iOS macOS
.package(url: "https://github.com/gaetanomatonti/Uno.git", from: "0.4.0")


A simple OTP generator written in Swift.


Currently this package supports Swift Package Manager only. More dependency managers may be supported in future releases.

Swift Package Manger

Swift Package Manager is a tool for managing the distribution of Swift Code. It's integrated in the Swift build system and can be used to automate the dependency management.

To add this package as a dependency of another Swift package you just need to add it to the dependencies value of your package manifest (the Package.swift file).

dependencies: [
  .package(url: "https://github.com/gaetanomatonti/Uno.git", from: "0.1.0"),

One-Time Password

An OTP (One-Time Password) is an authentication code that can only be used once. As such, it is often used in combination with a regular password to provide an extra layer of security (multi-factor authentication).

HMAC-based One-Time Password

A HOTP (where the "H" stands for Hash-based Message Authentication Code, or HMAC) is a one-time password generated from a cryptographic hash function and a static secret key. It also involves a moving factor that seeds into the generator function, usually a counter. Implementation follows the RFC-4226 specifications.

Time-based One-Time Password

A TOTP (Time-based One-Time Password) extends the HOTP by replacing the moving factor in the hashing function. While in the HOTP the counter is counter-based, in TOTPs it is time-based. This means that the OTP is only valid in a certain interval of time. The amount of time in which every OTP is valid is called timestep, and tends to be 30 seconds or 60 seconds in length. Implementation follows the RFC-6238 specifications.

Hashing Algorithms

While SHA1 is the most frequently used hash function to generate HMACs, SHA256 and SHA512 could also be used.


Stars: 3
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Release 0.4.0
34 weeks ago


  • Added a uri property to construct a otpauth URI from a Metadata instance

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics