Skip to main content
CrystalDocs
Search documentation
Search
Browse Docs
CrystalShards
About
class
CrOTP::TOTP
Inherits
CrOTP::OTP
<
Reference
<
Object
Constants
ALLOWED_ALGORITHMS = [
OpenSSL::Algorithm::SHA1
,
OpenSSL::Algorithm::SHA256
,
OpenSSL::Algorithm::SHA512
]
PERIOD = 30
Constructors
new
(secret :
String
, digits :
Int
= 6, algorithm :
OpenSSL::Algorithm
=
OpenSSL::Algorithm::SHA1
)
Source
Instance methods
authenticator_uri
(issuer :
String
, user :
String
) :
String
Source
authenticator_uri
(issuer :
String
) :
String
Source
generate
(at :
Int
=
Time
.utc.to_unix) :
String
Source
generate
(at :
Time
) :
String
Source
verify
(token :
String
, at :
Int
=
Time
.utc.to_unix, allowed_drift :
Int
= 0) :
Bool
Source
verify
(token :
String
, at :
Time
, allowed_drift :
Int
= 0) :
Bool
Source