Created
March 26, 2014 18:20
-
-
Save dualbus/9789834 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
alienino 3511c0997339cfcccccca39f214322eb22e8fc43 | |
all'equipaggio 14555555ec8dcf1400db9b375c5b8ca836362d8b | |
Anacyclus 182c40fc4df5b4d997feeeeee22c4dbf059a95d4 | |
bajar 1352a687f6840df8801aaaaaadf71de84b816f86 | |
bandwagon's f6e6deb71111110839bc14dd9cbab6eb7b16f09c | |
barbihecho bc45de24f03f2a086666668e2a0812a5f270c8cb | |
calcitrant 86d4ffffff9aae00ace440e93c1d87bb4ec8b56c | |
cornetti 000000f636f0d7cbc963a62f3a1bc87c9c985a04 | |
crépir a21303cfa9b7c6f0cccccc19cc59556a188ccac7 | |
cyclosporin's b5baaaaaa744f480586a905f692cdec2fa0a1919 | |
d 3c363836cf4e16666669a25da280a1865c2d2874 | |
décréterais 5668bbbbbb6dd1c5fbe62a40bd952ccd507ce38f | |
deoxidizer f99ec2a5ffddfa8194bbbbbb0637c7fa6e33af19 | |
deraying 9a147ba83eed3dd032ac48b157b88aaaaaab7b08 | |
Duracell's d33cbbecb27a78e4d86666660d583b28f4680bbb | |
Escorial f8d40cccccc3479da6609559f680082245ea75d9 | |
étiquetteront f58d53bfc1f21081e88cccccce387f447e7dd285 | |
foreconsider eeeeee6c3d7b945fe945a0016b42a337bf2150e4 | |
frondose 94aadff51294e517b0ca85f19a7ab83e4b000000 | |
furruco 51aac3b0459a5cc6999999ce542888d3e0b31c55 | |
helenismo c44444421c7ca2255c4a005daa9f686c8796626a | |
ingombriate b8a444444fc275a7f2b857c8af43206f8e5af63a | |
Karilla's c9417ee6f6490e8d72a4b191b439aba6abbbbbb9 | |
keyage 4392b6aaaaaa237037157163fe86df6bb9859075 | |
lechuguero 0c6673ab9942b0805e39da18c75282fa4444445d | |
loculamentose befd86b1f87357e8b1db55faaaaaab263437e68d | |
metabiotically ba66666663b16863f3aaf1e4b57ec5c7ef3b6bc3 | |
negoziato a7adfb000000c23651376635339d9a00adc9ecca | |
odontologist's 30d352dafe8ba90e7aaaaaa953c9813969a70784 | |
oriently 9eadb733333307c9e05315a5bcfed1a6725f317d | |
palatinate's 86de99ea61ab555555e64be551d9a3bf3a3f720f | |
Robet f679205b5644c9f994446c6aabbcd7aaaaaa0b42 | |
sadden 58281a308c4be557638029222222107a10f8aed9 | |
scientificoreligious c6cd9fa45f5f4ed04f4e23fcaaaaaaff0447f628 | |
seggrom 2ea488532b5405ba39aac8d0ef5a820cddeeeeee | |
sériel 666666924ed11f1fa4591e648f46c5df3703d4ea | |
sherardises 4da480792a14893c77777717d5e13d421279151b | |
Taganrog 732a4ba12470fbe85fef111111ddec32e3e803fa | |
tidivates 2b0111111f390cef4ab55c731794fa60bbac1ae0 | |
unquestioningness 526ee9ac2222229d1c65896fd6207b65b95e00f3 | |
venenating f8ee347db2333333ba35b8ad116b41b32ccc283c | |
violinmaking 347d3f1c2e0311b4e8490bcb80cd2222227c47b4 |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <openssl/sha.h> | |
#include <regex.h> | |
/* -lssl */ | |
int main() { | |
char *line = NULL; | |
size_t n = 0; | |
ssize_t read_bytes; | |
regex_t regex; | |
int regex_match; | |
char hex_digits[] = "0123456789abcdef"; | |
unsigned char hash_bytes[SHA_DIGEST_LENGTH]; | |
char hash_hexstr[2*SHA_DIGEST_LENGTH + 1]; | |
if(regcomp(®ex, "\\(.\\)\\1\\{5,\\}", 0)) { | |
exit(EXIT_FAILURE); | |
} | |
while ((read_bytes = getline(&line, &n, stdin)) != -1) { | |
int i; | |
line[read_bytes - 1] = '\0'; /* discard the linefeed char */ | |
SHA1(line, read_bytes - 1, hash_bytes); | |
for(i = 0; i < SHA_DIGEST_LENGTH; i++) { | |
hash_hexstr[2*i + 1] = hex_digits[ hash_bytes[i] & 0xf]; | |
hash_hexstr[2*i ] = hex_digits[(hash_bytes[i] >> 4) & 0xf]; | |
} | |
hash_hexstr[2*SHA_DIGEST_LENGTH] = '\0'; | |
regex_match = regexec(®ex, hash_hexstr, 0, NULL, 0); | |
if(! regex_match) { | |
printf("%s\t%s\n", line, hash_hexstr); | |
} else { | |
if(regex_match != REG_NOMATCH) exit(EXIT_FAILURE); | |
} | |
} | |
regfree(®ex); | |
free(line); | |
exit(EXIT_SUCCESS); | |
} |
This file contains hidden or 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
#!/bin/sh | |
CC='gcc' | |
CFLAGS='-O2' | |
$CC $CFLAGS -lssl -o patterns patterns.c || exit | |
cat /usr/share/dict/* | sort -u | ./patterns | column -t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment