Created
February 18, 2015 16:35
-
-
Save jmtd/f2b0347c0a7cbfba77ac to your computer and use it in GitHub Desktop.
PGP interestingness
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
def score(s): | |
i=1 | |
p = s[0] | |
for c in s[1:]: | |
if int(c,base=16) == int(p,base=16)+1: | |
i += 1 | |
p = c | |
return i | |
# or | |
def altscore(s): | |
i=1 | |
p = s[0] | |
for c in s[1:]: | |
if c == p: | |
i += 1 | |
p = c | |
return i | |
# and some | |
# grep --color -E '[A-F]+{6}' keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment