List of utility methods to do BigInteger From
BigInteger | byteArrayToBigInteger(final byte[] data) Convert a BCD byte[] to BigInteger StringBuilder stringBuilder = new StringBuilder(data.length * 2); for (final byte aData : data) { int digit = (aData & 0xF0) >> 4; if (digit < 0 || digit > 9) { throw new IllegalArgumentException("Invalid digit: " + digit); stringBuilder.append((char) (digit + 0x30)); digit = aData & 0x0F; ... |
BigInteger | ByteArrayToBigIntegerWithoutSign(byte[] array) Convert an array of bytes to a non-negative big integer. return new BigInteger(1, array); |
BigInteger | bytesToBigInteger(byte[] buffer) This function converts the bytes in a byte array to its corresponding big integer value. return new BigInteger(buffer); |
BigInteger | bytesToBigInteger(byte[] data) bytes To Big Integer return new BigInteger(1, data); |
BigInteger | bytesToBigInteger(byte[] data, int[] offset) Return the BigInteger represented by the bytes in data staring at offset offset[0] .
int length = bytesToInt(data, offset); byte[] bytes = new byte[length]; offset[0] += memcpy(bytes, 0, data, offset[0], length); return new BigInteger(bytes); |
BigInteger | convertToBigInteger(String s) convert To Big Integer if ((s == null) || s.equals("")) { return null; if (s.startsWith("+")) { s = s.substring(1); return convertToInteger(s); |
BigInteger | convertToBigInteger(String sequence) convert To Big Integer BigInteger biSequence = BigInteger.ZERO; int kmerSize = sequence.length(); for (int i = 0; i < kmerSize; i++) { char ch = sequence.charAt(i); if (ch == 'A') { biSequence = biSequence.add(BigInteger.valueOf(0)); } else if (ch == 'C') { biSequence = biSequence.add(BigInteger.valueOf(1)); ... |
BigInteger | getUnsignedBigInteger(byte[] data, int offset, int length) Returns a positive BigInteger from the given bytes. if (length == 0) { return BigInteger.ZERO; byte[] value = new byte[length + 1]; System.arraycopy(data, offset, value, 1, length); return new BigInteger(value); |
BigInteger | getUnsignedBigInteger(long x) Ensure that the passed long parameter will be interpreted as a positive value. BigInteger z = BigInteger.valueOf(x); if (z.signum() < 0) return z.add(x64); else return z; |
BigInteger | string2BigInteger(String plaintext) String 2 big integer big integer. String msg = base64Encode(plaintext);
return toBigInteger(msg);
|