(String algorithm)
| 28 | } |
| 29 | |
| 30 | private String generateString(String algorithm) { |
| 31 | try { |
| 32 | MessageDigest messageDigest = MessageDigest.getInstance(algorithm); |
| 33 | String characters = faker.lorem().characters(); |
| 34 | messageDigest.update(characters.getBytes(), 0, characters.length()); |
| 35 | return new BigInteger(1, messageDigest.digest()).toString(16); |
| 36 | } catch (NoSuchAlgorithmException noSuchAlgorithmException) { |
| 37 | throw new RuntimeException(noSuchAlgorithmException); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | } |