diff options
author | Andreas Straub <andy@strb.org> | 2015-07-07 19:28:35 +0200 |
---|---|---|
committer | Andreas Straub <andy@strb.org> | 2015-07-19 21:32:27 +0200 |
commit | 8fd46d40d63008e4855c3c1d48c5ac0eafb103d0 (patch) | |
tree | f6e5dd9272a4ddeb503d58a9d3a3bfaf521a9b12 /src/main/java/eu/siacs/conversations/utils/CryptoHelper.java | |
parent | 491f623708437f418497ecace2876e9c81708e72 (diff) |
Adapt prettifyFingerprint() to axolotl FP sizes
Diffstat (limited to 'src/main/java/eu/siacs/conversations/utils/CryptoHelper.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/CryptoHelper.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java b/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java index 2dec203d..c7c9ac42 100644 --- a/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java @@ -96,11 +96,10 @@ public final class CryptoHelper { } else if (fingerprint.length() < 40) { return fingerprint; } - StringBuilder builder = new StringBuilder(fingerprint); - builder.insert(8, " "); - builder.insert(17, " "); - builder.insert(26, " "); - builder.insert(35, " "); + StringBuilder builder = new StringBuilder(fingerprint.replaceAll("\\s","")); + for(int i=8;i<builder.length();i+=9) { + builder.insert(i, ' '); + } return builder.toString(); } |