We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39a2838 commit 72a108fCopy full SHA for 72a108f
core-java-modules/core-java/src/main/java/com/baeldung/uuid/UUIDGenerator.java
@@ -67,7 +67,7 @@ public static UUID type5UUIDFromBytes(byte[] name) {
67
} catch (NoSuchAlgorithmException nsae) {
68
throw new InternalError("MD5 not supported", nsae);
69
}
70
- byte[] bytes = md.digest(name);
+ byte[] bytes = Arrays.copyOfRange(md.digest(name), 0, 16);
71
bytes[6] &= 0x0f; /* clear version */
72
bytes[6] |= 0x50; /* set to version 5 */
73
bytes[8] &= 0x3f; /* clear variant */
0 commit comments