Authen-TOTP

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

    Returns 1 on success, undef if OTP doesn't match

    Usage:

        $gen->validate_otp(
                digits         =>      [6|8],
                period         =>      [30|60],
                algorithm      =>      "SHA1", #SHA256 and SHA512 are equally valid
                secret         =>      "the_same_random_stuff_you_used_to_generate_the_TOTP",
                when           =>      <epoch_to_use_as_reference>,
                tolerance      =>      <try this many iterations before/after when>
                otp            =>      <OTP to compare to>
        );

        $gen->otp( <when> ); # Get the TOTP token at <epoch_to_use>
        

# Revision History

    0.1.1
       Replace rand() with Crypt::PRNG::random_string_from() following

lib/Authen/TOTP.pm  view on Meta::CPAN

Returns 1 on success, undef if OTP doesn't match

Usage:

 $gen->validate_otp(
	 digits 	=>	[6|8],
	 period		=>	[30|60],
	 algorithm	=>	"SHA1", #SHA256 and SHA512 are equally valid
	 secret		=>	"the_same_random_stuff_you_used_to_generate_the_TOTP",
	 when		=>	<epoch_to_use_as_reference>,
	 tolerance	=>	<try this many iterations before/after when>
	 otp		=>	<OTP to compare to>
 );

 $gen->otp( <when> ); # Get the TOTP token at <epoch_to_use>
 
=back

=cut

=head1 Revision History



( run in 1.221 second using v1.01-cache-2.11-cpan-96521ef73a4 )