3: 2019-10-22 (Tue) 13:38:46 iseki  |
Cur: 2019-10-22 (Tue) 22:07:31 iseki  |
| #br | | #br |
| *** zxcvbn4j [#b663ab8c] | | *** zxcvbn4j [#b663ab8c] |
| + | - zxcvbn を改造 |
| + | - サーバサイド用 Java |
| - https://nulab.com/ja/blog/nulab/password-strength/ | | - https://nulab.com/ja/blog/nulab/password-strength/ |
| - https://github.com/nulab/zxcvbn4j | | - https://github.com/nulab/zxcvbn4j |
- | - サーバサイド用 | + | #br |
| **** jdk-13 [#a6a1f7b4] | | **** jdk-13 [#a6a1f7b4] |
| - jdk-13 ではエラーを起こす (2019 10/22) | | - jdk-13 ではエラーを起こす (2019 10/22) |
| - jdk-8 は OK | | - jdk-8 は OK |
| + | #br |
| + | *** Sample for zxcvbn4j [#vbc939b9] |
| + | |
| + | **** CheckPass.java [#g004c8dc] |
| + | |
| + | import java.io.BufferedReader; |
| + | import java.io.IOException; |
| + | import java.io.InputStreamReader; |
| + | |
| + | import com.nulabinc.zxcvbn.*; |
| + | |
| + | class CheckPass |
| + | { |
| + | public static void main(String[] args) |
| + | { |
| + | String str = null; |
| + | double score = 0.0; |
| + | |
| + | Zxcvbn zxcvbn = new Zxcvbn(); |
| + | InputStreamReader ist = new InputStreamReader(System.in); |
| + | BufferedReader buf = new BufferedReader(ist); |
| + | |
| + | try { |
| + | System.err.print("Input String: "); |
| + | str = buf.readLine(); |
| + | while(str!=null) { |
| + | Strength strength = zxcvbn.measure(str); |
| + | //score = strength.getGuesses(); |
| + | score = strength.getGuessesLog10(); |
| + | System.out.println("[" + str + "] is " + score); |
| + | System.err.print("\nInput String : "); |
| + | str = buf.readLine(); |
| + | } |
| + | } |
| + | catch (IOException e) { |
| + | e.printStackTrace(); |
| + | } |
| + | } |
| + | } |
| + | |
| + | **** コンパイル&実行 [#ja8d4350] |
| + | javac -classpath ./zxcvbn-1.3.0.jar CheckPass.java |
| + | java -classpath .:./zxcvbn-1.3.0.jar CheckPass |
| #br | | #br |