List of usage examples for org.apache.commons.codec.binary Hex getCharsetName
public String getCharsetName()
From source file:org.onebusaway.gtfs_realtime.alerts_producer_demo.GtfsRealtimeProviderImpl.java
/** * Generates a unique fingerprint of the specified value. * // w ww.ja v a2 s . com * @param value * @return an hex-string of the MD5 fingerprint of the specified value. */ private String getHashOfValue(String value) { try { MessageDigest digest = MessageDigest.getInstance("MD5"); digest.update(value.getBytes()); Hex hex = new Hex(); return new String(hex.encode(digest.digest()), hex.getCharsetName()); } catch (Exception ex) { throw new IllegalStateException(ex); } }