How to convert BigInteger to String in java
You want to use BigInteger.toByteArray() String msg = “Hello there!”; BigInteger bi = new BigInteger(msg.getBytes()); System.out.println(new String(bi.toByteArray())); // prints “Hello there!” The way I understand it is that you’re doing the following transformations: String —————–> byte[] ——————> BigInteger String.getBytes() BigInteger(byte[]) And you want the reverse: BigInteger ————————> byte[] ——————> String BigInteger.toByteArray() String(byte[]) Note that you … Read more