fixed the issue. Will look into that further commons-codec has Hex.encode(byteArray) you can also use Integer.toHexString(..) for each byte Just be careful when obtaining the bytes. Use the method getBytes(ecnoding) instead of the one without arguments which takes the platform encoding.
convert hexadecimal number string to double-precision number in java
Does that help Hi I want to convert string to some unique number in java. Exmple: "Production-0-1" to 100021 "Process-23-30" to 12310 And all return number has to be unique. I dont wanted to use hashCode as they can return duplicate like "Aa" and "BB" has same has code. Let me know math logic to create this is no method available.
String random = "Production-0-1";
String bi = new BigInteger(random.getBytes("UTF-8")).toString();
BigInteger numBig = new BigInteger(bi);