{"id":308,"date":"2009-10-21T00:34:21","date_gmt":"2009-10-20T15:34:21","guid":{"rendered":"http:\/\/ani2life.com\/wp\/?p=308"},"modified":"2009-10-21T00:34:21","modified_gmt":"2009-10-20T15:34:21","slug":"%ec%95%94%ed%98%b8-%eb%ac%b8%ec%9e%90%ec%97%b4%ec%9d%98-%eb%b3%b4%ec%95%88%eb%a0%88%eb%b2%a8-%ed%8f%89%ea%b0%80-%ed%95%a8%ec%88%98","status":"publish","type":"post","link":"https:\/\/ani2life.com\/wp\/?p=308","title":{"rendered":"\uc554\ud638 \ubb38\uc790\uc5f4\uc758 \ubcf4\uc548\ub808\ubca8 \ud3c9\uac00 \ud568\uc218"},"content":{"rendered":"<p>\ud68c\uc6d0\uac00\uc785 \uac19\uc740 \uac83\uc744 \ud560\ub54c \uc785\ub825\ud558\ub294 \uc554\ud638\uac00 \ubcf4\uc548\uc5d0 \uc548\uc804\ud55c\uc9c0 \uc5ec\ubd80\ub97c \ubc18\ud658\ud558\ub294 \ud568\uc218\ub97c \ub9cc\ub4e4\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n<p><br class=\"spacer_\" \/><\/p>\n<pre lang=\"php\" escaped=\"true\"><?php\r\n\/**\r\n * @brief \uc554\ud638\uc758 \ubcf4\uc548\ub808\ubca8\uc744 \ubc18\ud658\ud55c\ub2e4.\r\n * @details \ub808\ubca8\uc740 0~3\uc774\uba70 \uc22b\uc790\uac00 \ub192\uc744\uc218\ub85d \ubcf4\uc548\uc774 \ub6f0\uc5b4\ub0a8.\\n\r\n * \ubcf4\uc548\ub808\ubca8 0\uc740 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\ub294 \uac83\uc774 \uc88b\ub2e4.\r\n * @param $password string \uc554\ud638\r\n * @param $point_data array \uacc4\uc0b0\ub41c \uc810\uc218 \uc815\ubcf4\r\n * @return int \ubcf4\uc548\ub808\ubca8\r\n *\/\r\npublic static function password_level($password, &amp;$point_data = null) {\r\n    $point_data = array();\r\n\r\n    ## \ubb38\uc790\uc5f4 \ubd84\uc11d \ubc0f \uc810\uc218\uacc4\uc0b0 ##\r\n    $char_point = 0; \/\/ \ubb38\uc790 \uc810\uc218\r\n    $change_point = 0; \/\/ \ubcc0\ud658 \uc810\uc218\r\n\r\n    $unique_char = array(); \/\/ \uace0\uc720\ubb38\uc790\r\n    $old_char = $password[0]; \/\/ \uc774\uc804\ubb38\uc790(\uc2dc\uc791\uc740 \uccab\ubb38\uc790\uc640 \ub611\uac19\uac8c)\r\n    for ( $i = 0; $i < strlen($password); $i++ ) {\r\n        $char = $password[$i];\r\n\r\n        \/\/ \uace0\uc720\ubb38\uc790\r\n        $unique_char[$char] = 0;\r\n\r\n        \/\/ \ubb38\uc790 \uc810\uc218(6 ~ 16\uc790 \uae30\uc900): 6 ~ 7.2\r\n        if ( preg_match('\/[0-9]\/', $char) ) {\r\n            $char_point += 1;\r\n        } else if ( preg_match('\/[a-zA-Z]\/', $char) ) {\r\n            $char_point += 1.1;\r\n        } else if ( preg_match('\/[\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E]\/', $char) ) {\r\n            $char_point += 1.2;\r\n        } else {\r\n            return 0;\r\n        }\r\n\r\n        \/\/ \ubcc0\ud658 \uc810\uc218(6 ~ 16\uc790 \uae30\uc900): 0.05 ~ 1.5\r\n        $gap = ord($char) - ord($old_char);\r\n        if ( abs($gap) > 1 ) { \/\/ \uc5f0\uc18d\uc131 \uc5c6\uc774 \ubcc0\ud658\r\n            $change_point += 0.1;\r\n        } else if ( $gap < 0 ) { \/\/ \uc5ed\uc21c\uc11c\ub85c \ubcc0\ud658\r\n            $change_point += 0.05;\r\n        }\r\n        $old_char = $char;\r\n    }\r\n\r\n    \/\/ \ubb38\uc790\uae38\uc774 \uc810\uc218(6 ~ 16\uc790 \uae30\uc900): 0 ~ 2\r\n    $length_point = floor(strlen($password) \/ 6);\r\n\r\n    \/\/ \uace0\uc720\ubb38\uc790 \uc810\uc218(16\uc790 \uae30\uc900): 1 ~ 16\r\n    $unique_point = count($unique_char);\r\n\r\n    \/\/ \uc804\uccb4 \uc810\uc218(6 ~ 16\uc790 \uae30\uc900): 0 or 0.3 ~ 345.6\r\n    $total_point = $char_point * $change_point * $length_point * $unique_point;\r\n\r\n    \/\/ \uc810\uc218\uc815\ubcf4 \ucc38\uc870 \ubc30\uc5f4\r\n    $point_data = array(\r\n        'char' => $char_point,\r\n        'change' => $change_point,\r\n        'length' => $length_point,\r\n        'unique' => $unique_point,\r\n        'total' => $total_point,\r\n    );\r\n\r\n    ## \ubcf4\uc548 \ub808\ubca8 \ubc18\ud658 ##\r\n    \/\/ \uc804\uccb4 \uc810\uc218\ub97c \uc704\ud55c 4\uc885\ub958 \uc810\uc218\ub97c \uac01\uac01 '(\ucd5c\ub300\uac12 - \ucd5c\uc18c\uac12) \/ \ub808\ubca8'\uc758 \uac12\uc73c\ub85c,\r\n    \/\/ 4\uc885\ub958 \uc810\uc218\ub97c \uac01\uac01 \ub808\ubca8\ubcc4\ub85c \uacc4\uc0b0\ud558\uc5ec \ub808\ubca8\ubcc4 \uc810\uc218\ubc94\uc704\ub97c \uad6c\ud588\uc74c\r\n    if ( $total_point > 0 &amp;&amp; $total_point <= 16.96 ) {\r\n        return 1;\r\n    } else if ( $total_point > 16.96 &amp;&amp; $total_point <= 137.36 ) {\r\n        return 2;\r\n    } else if ( $total_point > 137.36 ) {\r\n        return 3;\r\n    } else {\r\n        return 0;\r\n    }\r\n}\r\n?><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\ud68c\uc6d0\uac00\uc785 \uac19\uc740 \uac83\uc744 \ud560\ub54c \uc785\ub825\ud558\ub294 \uc554\ud638\uac00 \ubcf4\uc548\uc5d0 \uc548\uc804\ud55c\uc9c0 \uc5ec\ubd80\ub97c \ubc18\ud658\ud558\ub294 \ud568\uc218\ub97c \ub9cc\ub4e4\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[7],"tags":[129,99,130,125,126,124,127,123,128,97],"_links":{"self":[{"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/308"}],"collection":[{"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=308"}],"version-history":[{"count":20,"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/308\/revisions\/328"}],"wp:attachment":[{"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ani2life.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}