Created
April 18, 2014 06:54
-
-
Save sancome/11028279 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Time::gmtime; | |
use Time::localtime; | |
sub gcd { | |
my ($a, $b) = @_; | |
return ( $b ? gcd($b ,$a % $b) : $a); | |
} | |
my $tm = localtime(); | |
my $tmUTC = gmtime (); | |
printf("password for today is: %x%02d-%02x%02d\n" | |
, $tm ->mon() + 1, $tm ->mon() + 1, $tm ->mday(), gcd($tm ->mon() + 1, $tm ->mday())); | |
printf("password for today (UTC) is: %x%02d-%02x%02d\n" | |
, $tmUTC->mon() + 1, $tmUTC->mon() + 1, $tmUTC->mday(), gcd($tmUTC->mon() + 1, $tmUTC->mday())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment