From ee21a2724c707efbb3ec7e419772455028cc8a69 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 21 Nov 2013 21:35:29 -0500 Subject: [PATCH] generate fingerprint as a hex String, leave formatting for display code When the fingerprint is generated to be stored in the database in the repo table, make it a single String that is a hex number. This is a natural format for working with the fingerprints programmatically. The display formatting can then be handled by the display code, and can freely change without affecting the underlying function of the code. --- src/org/fdroid/fdroid/ManageRepo.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/org/fdroid/fdroid/ManageRepo.java b/src/org/fdroid/fdroid/ManageRepo.java index 8b91e440d..efdf932e4 100644 --- a/src/org/fdroid/fdroid/ManageRepo.java +++ b/src/org/fdroid/fdroid/ManageRepo.java @@ -238,10 +238,8 @@ public class ManageRepo extends ListActivity { digest.update(Hasher.unhex(repo.pubkey)); byte[] fingerprint = digest.digest(); Formatter formatter = new Formatter(new StringBuilder()); - formatter.format("%02X", fingerprint[0]); for (int i = 1; i < fingerprint.length; i++) { - formatter.format(i % 5 == 0 ? " %02X" : ":%02X", - fingerprint[i]); + formatter.format("%02X", fingerprint[i]); } ret = formatter.toString(); formatter.close();