X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Futil%2FUniqueID.java;h=1cc082e816bf4ba1aaca592afe6703e76255856c;hb=74b1644fb1780ad83c7c7015a989fbc098e485c2;hp=e7b56d4ac7dbef057d29ccfaa7b59c6a69c369ce;hpb=566a2343c3dfd28e4275d5c17b779a92e8d13f78;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/util/UniqueID.java b/src/net/sf/openrocket/util/UniqueID.java index e7b56d4a..1cc082e8 100644 --- a/src/net/sf/openrocket/util/UniqueID.java +++ b/src/net/sf/openrocket/util/UniqueID.java @@ -1,12 +1,8 @@ package net.sf.openrocket.util; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; -import net.sf.openrocket.gui.main.ExceptionHandler; - public class UniqueID { private static AtomicInteger nextId = new AtomicInteger(1); @@ -34,34 +30,4 @@ public class UniqueID { return UUID.randomUUID().toString(); } - - /** - * Return a hashed unique ID that contains no information whatsoever of the - * originating computer. - * - * @return a unique identifier string that contains no information about the computer. - */ - public static String generateHashedID() { - String id = UUID.randomUUID().toString(); - - try { - MessageDigest algorithm = MessageDigest.getInstance("MD5"); - algorithm.reset(); - algorithm.update(id.getBytes()); - byte[] digest = algorithm.digest(); - - StringBuilder sb = new StringBuilder(); - for (byte b: digest) { - sb.append(String.format("%02X", 0xFF & b)); - } - id = sb.toString(); - - } catch (NoSuchAlgorithmException e) { - ExceptionHandler.handleErrorCondition(e); - id = "" + id.hashCode(); - } - - return id; - } - }