Time-based one-time password algorithm: Difference between revisions
Time-based one-time password algorithm (view source)
Revision as of 15:02, 31 March 2019
, 5 years ago→{{header|Perl 6}}: fix incorrect substr offset ; update output
(added Perl 6) |
m (→{{header|Perl 6}}: fix incorrect substr offset ; update output) |
||
Line 320:
sub totp (Str \secret, DateTime \counter, Int \T0=0, Int \T1=30 --> Str) {
my \key = ( counter - DateTime.new(T0) ).Int div T1;
return hmac-hex(key.Str, secret, &sha1).substr(0,
}
Line 337:
{{out}}
<pre>Deterministic output at 2039-01-01T00:00:00Z with fixed checks,
34ca2a
acfa3f
950fc3
950fc3
a2d4ea
a2d4ea
Current time output at 2019-03-
4e36de
d4e9f8
d4e9f8
077e2c
63bbb5
=={{header|PicoLisp}}==
|