X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FProfile.java;h=76e0acf1c56263f20402c20eff8aed6b7df206e5;hp=7d8a0bd2420442007b2f09703231bedf40b601a5;hb=b9fc06f5bf20b1c0d5e7c5e9b49e87581a843ee7;hpb=7e43bed09912f401dc53be9b998ebd1072656ffe diff --git a/src/main/java/net/pterodactylus/sone/data/Profile.java b/src/main/java/net/pterodactylus/sone/data/Profile.java index 7d8a0bd..76e0acf 100644 --- a/src/main/java/net/pterodactylus/sone/data/Profile.java +++ b/src/main/java/net/pterodactylus/sone/data/Profile.java @@ -20,6 +20,7 @@ package net.pterodactylus.sone.data; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; +import static java.nio.charset.StandardCharsets.UTF_8; import java.util.ArrayList; import java.util.Collections; @@ -429,34 +430,34 @@ public class Profile implements Fingerprintable { @Override public String getFingerprint() { Hasher hash = Hashing.sha256().newHasher(); - hash.putString("Profile("); + hash.putString("Profile(", UTF_8); if (firstName != null) { - hash.putString("FirstName(").putString(firstName).putString(")"); + hash.putString("FirstName(", UTF_8).putString(firstName, UTF_8).putString(")", UTF_8); } if (middleName != null) { - hash.putString("MiddleName(").putString(middleName).putString(")"); + hash.putString("MiddleName(", UTF_8).putString(middleName, UTF_8).putString(")", UTF_8); } if (lastName != null) { - hash.putString("LastName(").putString(lastName).putString(")"); + hash.putString("LastName(", UTF_8).putString(lastName, UTF_8).putString(")", UTF_8); } if (birthDay != null) { - hash.putString("BirthDay(").putInt(birthDay).putString(")"); + hash.putString("BirthDay(", UTF_8).putInt(birthDay).putString(")", UTF_8); } if (birthMonth != null) { - hash.putString("BirthMonth(").putInt(birthMonth).putString(")"); + hash.putString("BirthMonth(", UTF_8).putInt(birthMonth).putString(")", UTF_8); } if (birthYear != null) { - hash.putString("BirthYear(").putInt(birthYear).putString(")"); + hash.putString("BirthYear(", UTF_8).putInt(birthYear).putString(")", UTF_8); } if (avatar != null) { - hash.putString("Avatar(").putString(avatar).putString(")"); + hash.putString("Avatar(", UTF_8).putString(avatar, UTF_8).putString(")", UTF_8); } - hash.putString("ContactInformation("); + hash.putString("ContactInformation(", UTF_8); for (Field field : fields) { - hash.putString(field.getName()).putString("(").putString(field.getValue()).putString(")"); + hash.putString(field.getName(), UTF_8).putString("(", UTF_8).putString(field.getValue(), UTF_8).putString(")", UTF_8); } - hash.putString(")"); - hash.putString(")"); + hash.putString(")", UTF_8); + hash.putString(")", UTF_8); return hash.hash().toString(); }