List of utility methods to do BigInteger to
String | toStr(BigInteger number) to Str StringBuilder plaintext = new StringBuilder(BLOCK_SIZE + 1); String plaintextNumber = number.toString(); plaintextNumber = plaintextNumber.substring(1, plaintextNumber.length()); for (int i = 0; i < plaintextNumber.length(); i += 3) { String blockString = plaintextNumber.substring(i, i + 3); int block = Integer.parseInt(blockString); plaintext.append((char) block); return plaintext.toString(); |
String | toString(BigInteger bi) Converte de BigInteger para String return bi.toString(16);
|
String | toString(BigInteger[] vector) BigInteger array to string if (vector.length == 0) return "[]"; String result = "[" + vector[0]; for (int i = 1; i < vector.length; i++) result += "," + vector[i]; return result + "]"; |
long[] | toUnsigned(final BigInteger[] ulong) to Unsigned final long[] retVal = new long[ulong.length]; for (int i = 0; i < retVal.length; i++) { retVal[i] = toUnsigned(ulong[i]); return retVal; |
BigInteger | toUnsignedBigInteger(long i) Return a BigInteger equal to the unsigned value of the argument. if (i >= 0L) return BigInteger.valueOf(i); else { int upper = (int) (i >>> 32); int lower = (int) i; return (BigInteger.valueOf(toUnsignedLong(upper))).shiftLeft(32) .add(BigInteger.valueOf(toUnsignedLong(lower))); |
BigInteger | toUnsignedBigInteger(long number) to Unsigned Big Integer return number < 0L ? BigInteger.ONE.shiftLeft(64).add(BigInteger.valueOf(number))
: BigInteger.valueOf(number);
|