knitr::opts_knit$set(upload.fun = knitr::imgur_upload)
d <- read.dcf("DESCRIPTION")
title <- d[colnames(d) == "Title"]
cat(c("# ", paste(trimws(strsplit(title, "\n")[[1]]), collapse = " ")))

check codecov CRAN_Status_Badge

Github: https://github.com/randy3k/otp

Documentation: https://randy3k.github.io/otp

cat(d[colnames(d) == "Description"])

Installation

You can install the released version of otp from CRAN with:

install.packages("otp")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("randy3k/otp")

Example

library(otp)

HMAC based One Time Password (HOTP)

p <- HOTP$new("JBSWY3DPEHPK3PXP")
p$at(8)
p$verify("964230", 8)

Time based One Time Password (TOTP)

p <- TOTP$new("JBSWY3DPEHPK3PXP")
(code <- p$now())
p$verify(code)
raster::image(
  qrencoder::qrencode_raster(p$provisioning_uri("otp")),
  asp = 1, col = c("white", "black"), axes = FALSE,
  xlab = "", ylab = ""
)

Related projects



randy3k/otp documentation built on Nov. 10, 2021, 3:08 p.m.