å ç¢ãªãã¹ã¯ã¼ããå¼·å¶ãããã¯ããã¯
ãã£ã±ããµã¼ãã¹å´ã§å ç¢ãªãã¹ã¯ã¼ããã¦ã¼ã¶ã¼ã«å¼·å¶ããä»çµã¿ãç¡ãã¨åé¡ããããµã¼ãã¹ã¨è¨ãã®ã¯ããããããã£ã¦äºã§ãPerlã§åºæ¥ãéãç°¡åã«ããããä»çµã¿ãä½ããªãããªã¨ã
å¹¾ã¤ãããã¯ã¢ãããã¦ã¿ã¾ããã
Data::Passwordã¢ã¸ã¥ã¼ã«ã使ã
çã£å ã«ãããUNIXç³»OSã§ã®ãã¹ã¯ã¼ãã®å¼·åº¦ãã§ãã¯ã¨ä¼¼ãã¢ã¸ã¥ã¼ã«ã®ããã§ãã
use Data::Password qw(:all); print IsBadPassword("hogehoge");
æååã表示ããã¡ããå ´åã¯NGãªãã¹ã¯ã¼ãã
ãã®ã¢ã¸ã¥ã¼ã«ã¯è¾æ¸è¨å®ãåºæ¥ãããã§ãã
@Data::Password::DICTIONARIESã«è¾æ¸ãã¡ã¤ã«ãæå®ãã¦ããã¨ããã®å
容ãè¦ã¦ãããã¿ããã
ãããã¡ãªãã¹ã¯ã¼ãéã¯ftp://ftp.ox.ac.uk/pub/wordlists/ã«è¨èªå¥ã«ããã¾ãã
ã¾ãUNIXç³»OSã®ããã«ã¦ã¼ã¶ã¼åã¨ã®ã³ã³ããããã¾ãã
use Data::Password qw(:all); print IsBadPasswordForUNIX("zigorou", "hogehoge");
Data::Password::Checkã¢ã¸ã¥ã¼ã«ã使ã (追è¨1: 2007-10-29T03:30:04+09:00)
ãã®ã¢ã¸ã¥ã¼ã«ã¯çµæ§ä½¿ãåæãè¯ãããã
use Data::Dump qw(dump); use Data::Password::Check; my $pwchk = Data::Password::Check->check({ password => "hogehoge" }); if ($pwchk->has_errors) { print dump($pwchk->error_list); }
checkã¡ã½ããæã«æ¤è¨¼ãããã£ã¼ã«ãå¹¾ã¤ãè¨å®åºæ¥ã模æ§ã
String::Trigramã¢ã¸ã¥ã¼ã«ã使ã
livedoor Techブログ : String::Trigram でテキストの類似度を測るã«ãã³ããå¾ã¦ãªãã§ããã©ããããã¡ãªãã¹ã¯ã¼ãã£ã¦ãçã£å ã«æããã®ã¯
- JOE
- èªåã®ã¢ã«ã¦ã³ãåï¼èªçæ¥ã®æ°å
- èªåã®ã¢ã«ã¦ã³ãåã®ç½®æ
ã¨ããªãã§ããããã¤ã¾ããã¨ã®ã¢ã«ã¦ã³ãåã«ä¼¼ã¦ããã±ã¼ã¹ãå¤ãã
ã£ã¦äºã¯é¡ä¼¼åº¦ãé«ããã¹ã¯ã¼ããè¨ç®ãã¦ããã¦ããã®é¾å¤ãè¶
ããç©ã¯NGã¿ãããªå¤å®ãã¦ãããã°å¼·åºãªãã¹ã¯ã¼ãã«ãªãããããªãã®ããªã¨ã
use String::Trigram; print String::Trigram::compare("zigorou", "zigo1224");
çµæã¯ã
0.266666666666667
ã¡ãªã¿ã«å®å ¨ä¸è´ã1ã§ãã
ã¾ã¨ã
- ãããã¡ãªè¾æ¸ã¢ã¿ãã¯ã§å¼ã£ãããã®ã¯ãã¡
- JOEãã¡
- ä¼¼ããã¦ã¦ããã¡
ã«ããã«è¨å·ãå
¥ããªãããã¡ã£ã¦æ¡ä»¶ã¤ãããç¸å½ç¡¬ããã¹ã¯ã¼ããªããããªãããããã
è¦ãã¥ãããã©ãï½
ä»ã«ããããããããã¡ãªã±ã¼ã¹ãããã£ã¡ããããã©ããµã¼ãã¹å´ã§ãããããã§ãã¯ããã¦ãããã®ã¯ãã¯ãã¦ã¼ã¶ã¼ã«å¯¾ãã¦è¦ªåãããªãããªã¨æãããã§ãã