totp

command module
v0.0.0-...-6c82b8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

totp

Simple CLI demonstration for Time-based One-Time Passwords (TOTP).

Requirements

  • Go 1.18+

Build

go build ./...

Usage

Generate a setup URI:

go run . setup --issuer Provider --account user@example.com

Generate a TOTP code from a Base32 secret:

go run . code JBSWY3DPEHPK3PXP

URI format

otpauth://totp/{{issuer}}:{{account_name}}?secret={{base32_secret}}&issuer={{issuer}}&algorithm={{algorithm}}&digits={{digits}}&period={{period}}
  • algorithm: SHA-1
  • issuer: provider or service name
  • account_name: account identifier (for example email)
  • digits: number of digits (commonly 6 or 8; default 6)
  • period: code validity period in seconds (default 30)

References

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
exmaple
otp command
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址