Генерация 8d-рандома @return
()
| 159 | * @return |
| 160 | */ |
| 161 | public static String generate8d() { |
| 162 | byte[] digest = new byte[4]; |
| 163 | for (int i = 0; i < 4; i++) { |
| 164 | long a = Math.round(Integer.MAX_VALUE * Math.random()); |
| 165 | long b = Math.round(Integer.MIN_VALUE * Math.random()); |
| 166 | long c = a ^ b; |
| 167 | byte d = (byte) ((c >> 12) & 0xff); |
| 168 | digest[i] = d; |
| 169 | } |
| 170 | return String.format("%02x%02x%02x%02x", digest[0], digest[1], |
| 171 | digest[2], digest[3]); |
| 172 | } |
| 173 | |
| 174 | public static String generateTic() { |
| 175 | char[] chars = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'h', 'i', |
no test coverage detected