Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/main/java/de/mineking/javautils/ID.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static ID decode(@NotNull byte[] data) {

@NotNull
public String asString() {
return toString().substring(2); //Remove 2 leading zeros
return toString(data).substring(2); //Remove 2 leading zeros
}

@NotNull
Expand All @@ -97,8 +97,13 @@ public boolean equals(Object obj) {
return obj instanceof ID i && Arrays.equals(data, i.data);
}

@Override
public int hashCode() {
return Arrays.hashCode(data);
}

@Override
public String toString() {
return toString(data);
return asString();
}
}