test_class.file: core/src/test/java/com/google/bitcoin/core/UtilsTest.java
test_class.identifier: UtilsTest
test_case.body: @Test
      public void testReverseBytes() {
          Assert.assertArrayEquals(new byte[] {1,2,3,4,5}, Utils.reverseBytes(new byte[] {5,4,3,2,1}));
      }
test_case.class_method_signature: UtilsTest.testReverseBytes()
test_case.full_signature: @Test public void testReverseBytes()
test_case.identifier: testReverseBytes
test_case.invocations: assertArrayEquals reverseBytes
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReverseBytes()
focal_class.declarator: NEGATIVE_ONE = BigInteger.valueOf(-1)
focal_class.modifier: public static final
focal_class.original_string: public static final BigInteger NEGATIVE_ONE = BigInteger.valueOf(-1);
focal_class.type: BigInteger
focal_class.var_name: NEGATIVE_ONE
focal_class.declarator: digest
focal_class.modifier: private static final
focal_class.original_string: private static final MessageDigest digest;
focal_class.type: MessageDigest
focal_class.var_name: digest
focal_class.declarator: BITCOIN_SIGNED_MESSAGE_HEADER = CoinDefinition.coinName + " Signed Message:\n"
focal_class.modifier: public static final
focal_class.original_string: public static final String BITCOIN_SIGNED_MESSAGE_HEADER = CoinDefinition.coinName + " Signed Message:\n";
focal_class.type: String
focal_class.var_name: BITCOIN_SIGNED_MESSAGE_HEADER
focal_class.declarator: BITCOIN_SIGNED_MESSAGE_HEADER_BYTES = BITCOIN_SIGNED_MESSAGE_HEADER.getBytes(Charsets.UTF_8)
focal_class.modifier: public static final
focal_class.original_string: public static final byte[] BITCOIN_SIGNED_MESSAGE_HEADER_BYTES = BITCOIN_SIGNED_MESSAGE_HEADER.getBytes(Charsets.UTF_8);
focal_class.type: byte[]
focal_class.var_name: BITCOIN_SIGNED_MESSAGE_HEADER_BYTES
focal_class.declarator: COIN = new BigInteger("100000000", 10)
focal_class.modifier: public static final
focal_class.original_string: public static final BigInteger COIN = new BigInteger("100000000", 10);
focal_class.type: BigInteger
focal_class.var_name: COIN
focal_class.declarator: CENT = new BigInteger("1000000", 10)
focal_class.modifier: public static final
focal_class.original_string: public static final BigInteger CENT = new BigInteger("1000000", 10);
focal_class.type: BigInteger
focal_class.var_name: CENT
focal_class.declarator: mockSleepQueue
focal_class.modifier: private static
focal_class.original_string: private static BlockingQueue<Boolean> mockSleepQueue;
focal_class.type: BlockingQueue<Boolean>
focal_class.var_name: mockSleepQueue
focal_class.declarator: mockTime
focal_class.modifier: public static volatile
focal_class.original_string: public static volatile Date mockTime;
focal_class.type: Date
focal_class.var_name: mockTime
focal_class.declarator: bitMask[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}
focal_class.modifier: private static final
focal_class.original_string: private static final int bitMask[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
focal_class.type: int
focal_class.var_name: bitMask
focal_class.file: core/src/main/java/com/google/bitcoin/core/Utils.java
focal_class.identifier: Utils
focal_class.class_method_signature: Utils.toNanoCoins(int coins, int cents)
focal_class.full_signature: public static BigInteger toNanoCoins(int coins, int cents)
focal_class.identifier: toNanoCoins
focal_class.modifiers: public static
focal_class.parameters: (int coins, int cents)
focal_class.return: BigInteger
focal_class.signature: BigInteger toNanoCoins(int coins, int cents)
focal_class.class_method_signature: Utils.bigIntegerToBytes(BigInteger b, int numBytes)
focal_class.full_signature: public static byte[] bigIntegerToBytes(BigInteger b, int numBytes)
focal_class.identifier: bigIntegerToBytes
focal_class.modifiers: public static
focal_class.parameters: (BigInteger b, int numBytes)
focal_class.return: byte[]
focal_class.signature: byte[] bigIntegerToBytes(BigInteger b, int numBytes)
focal_class.class_method_signature: Utils.toNanoCoins(String coins)
focal_class.full_signature: public static BigInteger toNanoCoins(String coins)
focal_class.identifier: toNanoCoins
focal_class.modifiers: public static
focal_class.parameters: (String coins)
focal_class.return: BigInteger
focal_class.signature: BigInteger toNanoCoins(String coins)
focal_class.class_method_signature: Utils.uint32ToByteArrayBE(long val, byte[] out, int offset)
focal_class.full_signature: public static void uint32ToByteArrayBE(long val, byte[] out, int offset)
focal_class.identifier: uint32ToByteArrayBE
focal_class.modifiers: public static
focal_class.parameters: (long val, byte[] out, int offset)
focal_class.return: void
focal_class.signature: void uint32ToByteArrayBE(long val, byte[] out, int offset)
focal_class.class_method_signature: Utils.uint32ToByteArrayLE(long val, byte[] out, int offset)
focal_class.full_signature: public static void uint32ToByteArrayLE(long val, byte[] out, int offset)
focal_class.identifier: uint32ToByteArrayLE
focal_class.modifiers: public static
focal_class.parameters: (long val, byte[] out, int offset)
focal_class.return: void
focal_class.signature: void uint32ToByteArrayLE(long val, byte[] out, int offset)
focal_class.class_method_signature: Utils.uint64ToByteArrayLE(long val, byte[] out, int offset)
focal_class.full_signature: public static void uint64ToByteArrayLE(long val, byte[] out, int offset)
focal_class.identifier: uint64ToByteArrayLE
focal_class.modifiers: public static
focal_class.parameters: (long val, byte[] out, int offset)
focal_class.return: void
focal_class.signature: void uint64ToByteArrayLE(long val, byte[] out, int offset)
focal_class.class_method_signature: Utils.uint32ToByteStreamLE(long val, OutputStream stream)
focal_class.full_signature: public static void uint32ToByteStreamLE(long val, OutputStream stream)
focal_class.identifier: uint32ToByteStreamLE
focal_class.modifiers: public static
focal_class.parameters: (long val, OutputStream stream)
focal_class.return: void
focal_class.signature: void uint32ToByteStreamLE(long val, OutputStream stream)
focal_class.class_method_signature: Utils.int64ToByteStreamLE(long val, OutputStream stream)
focal_class.full_signature: public static void int64ToByteStreamLE(long val, OutputStream stream)
focal_class.identifier: int64ToByteStreamLE
focal_class.modifiers: public static
focal_class.parameters: (long val, OutputStream stream)
focal_class.return: void
focal_class.signature: void int64ToByteStreamLE(long val, OutputStream stream)
focal_class.class_method_signature: Utils.uint64ToByteStreamLE(BigInteger val, OutputStream stream)
focal_class.full_signature: public static void uint64ToByteStreamLE(BigInteger val, OutputStream stream)
focal_class.identifier: uint64ToByteStreamLE
focal_class.modifiers: public static
focal_class.parameters: (BigInteger val, OutputStream stream)
focal_class.return: void
focal_class.signature: void uint64ToByteStreamLE(BigInteger val, OutputStream stream)
focal_class.class_method_signature: Utils.doubleDigest(byte[] input)
focal_class.full_signature: public static byte[] doubleDigest(byte[] input)
focal_class.identifier: doubleDigest
focal_class.modifiers: public static
focal_class.parameters: (byte[] input)
focal_class.return: byte[]
focal_class.signature: byte[] doubleDigest(byte[] input)
focal_class.class_method_signature: Utils.scryptDigest(byte[] input)
focal_class.full_signature: public static byte[] scryptDigest(byte[] input)
focal_class.identifier: scryptDigest
focal_class.modifiers: public static
focal_class.parameters: (byte[] input)
focal_class.return: byte[]
focal_class.signature: byte[] scryptDigest(byte[] input)
focal_class.class_method_signature: Utils.doubleDigest(byte[] input, int offset, int length)
focal_class.full_signature: public static byte[] doubleDigest(byte[] input, int offset, int length)
focal_class.identifier: doubleDigest
focal_class.modifiers: public static
focal_class.parameters: (byte[] input, int offset, int length)
focal_class.return: byte[]
focal_class.signature: byte[] doubleDigest(byte[] input, int offset, int length)
focal_class.class_method_signature: Utils.singleDigest(byte[] input, int offset, int length)
focal_class.full_signature: public static byte[] singleDigest(byte[] input, int offset, int length)
focal_class.identifier: singleDigest
focal_class.modifiers: public static
focal_class.parameters: (byte[] input, int offset, int length)
focal_class.return: byte[]
focal_class.signature: byte[] singleDigest(byte[] input, int offset, int length)
focal_class.class_method_signature: Utils.doubleDigestTwoBuffers(byte[] input1, int offset1, int length1,
                                                  byte[] input2, int offset2, int length2)
focal_class.full_signature: public static byte[] doubleDigestTwoBuffers(byte[] input1, int offset1, int length1,
                                                  byte[] input2, int offset2, int length2)
focal_class.identifier: doubleDigestTwoBuffers
focal_class.modifiers: public static
focal_class.parameters: (byte[] input1, int offset1, int length1,
                                                  byte[] input2, int offset2, int length2)
focal_class.return: byte[]
focal_class.signature: byte[] doubleDigestTwoBuffers(byte[] input1, int offset1, int length1,
                                                  byte[] input2, int offset2, int length2)
focal_class.class_method_signature: Utils.isLessThanUnsigned(long n1, long n2)
focal_class.full_signature: public static boolean isLessThanUnsigned(long n1, long n2)
focal_class.identifier: isLessThanUnsigned
focal_class.modifiers: public static
focal_class.parameters: (long n1, long n2)
focal_class.return: boolean
focal_class.signature: boolean isLessThanUnsigned(long n1, long n2)
focal_class.class_method_signature: Utils.bytesToHexString(byte[] bytes)
focal_class.full_signature: public static String bytesToHexString(byte[] bytes)
focal_class.identifier: bytesToHexString
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes)
focal_class.return: String
focal_class.signature: String bytesToHexString(byte[] bytes)
focal_class.class_method_signature: Utils.reverseBytes(byte[] bytes)
focal_class.full_signature: public static byte[] reverseBytes(byte[] bytes)
focal_class.identifier: reverseBytes
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes)
focal_class.return: byte[]
focal_class.signature: byte[] reverseBytes(byte[] bytes)
focal_class.class_method_signature: Utils.reverseDwordBytes(byte[] bytes, int trimLength)
focal_class.full_signature: public static byte[] reverseDwordBytes(byte[] bytes, int trimLength)
focal_class.identifier: reverseDwordBytes
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int trimLength)
focal_class.return: byte[]
focal_class.signature: byte[] reverseDwordBytes(byte[] bytes, int trimLength)
focal_class.class_method_signature: Utils.readUint32(byte[] bytes, int offset)
focal_class.full_signature: public static long readUint32(byte[] bytes, int offset)
focal_class.identifier: readUint32
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: long
focal_class.signature: long readUint32(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.readInt64(byte[] bytes, int offset)
focal_class.full_signature: public static long readInt64(byte[] bytes, int offset)
focal_class.identifier: readInt64
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: long
focal_class.signature: long readInt64(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.readUint32BE(byte[] bytes, int offset)
focal_class.full_signature: public static long readUint32BE(byte[] bytes, int offset)
focal_class.identifier: readUint32BE
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: long
focal_class.signature: long readUint32BE(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.readUint16BE(byte[] bytes, int offset)
focal_class.full_signature: public static int readUint16BE(byte[] bytes, int offset)
focal_class.identifier: readUint16BE
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: int
focal_class.signature: int readUint16BE(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.sha256hash160(byte[] input)
focal_class.full_signature: public static byte[] sha256hash160(byte[] input)
focal_class.identifier: sha256hash160
focal_class.modifiers: public static
focal_class.parameters: (byte[] input)
focal_class.return: byte[]
focal_class.signature: byte[] sha256hash160(byte[] input)
focal_class.class_method_signature: Utils.bitcoinValueToFriendlyString(BigInteger value)
focal_class.full_signature: public static String bitcoinValueToFriendlyString(BigInteger value)
focal_class.identifier: bitcoinValueToFriendlyString
focal_class.modifiers: public static
focal_class.parameters: (BigInteger value)
focal_class.return: String
focal_class.signature: String bitcoinValueToFriendlyString(BigInteger value)
focal_class.class_method_signature: Utils.bitcoinValueToPlainString(BigInteger value)
focal_class.full_signature: public static String bitcoinValueToPlainString(BigInteger value)
focal_class.identifier: bitcoinValueToPlainString
focal_class.modifiers: public static
focal_class.parameters: (BigInteger value)
focal_class.return: String
focal_class.signature: String bitcoinValueToPlainString(BigInteger value)
focal_class.class_method_signature: Utils.decodeMPI(byte[] mpi, boolean hasLength)
focal_class.full_signature: public static BigInteger decodeMPI(byte[] mpi, boolean hasLength)
focal_class.identifier: decodeMPI
focal_class.modifiers: public static
focal_class.parameters: (byte[] mpi, boolean hasLength)
focal_class.return: BigInteger
focal_class.signature: BigInteger decodeMPI(byte[] mpi, boolean hasLength)
focal_class.class_method_signature: Utils.encodeMPI(BigInteger value, boolean includeLength)
focal_class.full_signature: public static byte[] encodeMPI(BigInteger value, boolean includeLength)
focal_class.identifier: encodeMPI
focal_class.modifiers: public static
focal_class.parameters: (BigInteger value, boolean includeLength)
focal_class.return: byte[]
focal_class.signature: byte[] encodeMPI(BigInteger value, boolean includeLength)
focal_class.class_method_signature: Utils.decodeCompactBits(long compact)
focal_class.full_signature: public static BigInteger decodeCompactBits(long compact)
focal_class.identifier: decodeCompactBits
focal_class.modifiers: public static
focal_class.parameters: (long compact)
focal_class.return: BigInteger
focal_class.signature: BigInteger decodeCompactBits(long compact)
focal_class.class_method_signature: Utils.rollMockClock(int seconds)
focal_class.full_signature: public static Date rollMockClock(int seconds)
focal_class.identifier: rollMockClock
focal_class.modifiers: public static
focal_class.parameters: (int seconds)
focal_class.return: Date
focal_class.signature: Date rollMockClock(int seconds)
focal_class.class_method_signature: Utils.rollMockClockMillis(long millis)
focal_class.full_signature: public static Date rollMockClockMillis(long millis)
focal_class.identifier: rollMockClockMillis
focal_class.modifiers: public static
focal_class.parameters: (long millis)
focal_class.return: Date
focal_class.signature: Date rollMockClockMillis(long millis)
focal_class.class_method_signature: Utils.setMockClock(long mockClock)
focal_class.full_signature: public static void setMockClock(long mockClock)
focal_class.identifier: setMockClock
focal_class.modifiers: public static
focal_class.parameters: (long mockClock)
focal_class.return: void
focal_class.signature: void setMockClock(long mockClock)
focal_class.class_method_signature: Utils.now()
focal_class.full_signature: public static Date now()
focal_class.identifier: now
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Date
focal_class.signature: Date now()
focal_class.class_method_signature: Utils.currentTimeMillis()
focal_class.full_signature: public static long currentTimeMillis()
focal_class.identifier: currentTimeMillis
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long currentTimeMillis()
focal_class.class_method_signature: Utils.copyOf(byte[] in, int length)
focal_class.full_signature: public static byte[] copyOf(byte[] in, int length)
focal_class.identifier: copyOf
focal_class.modifiers: public static
focal_class.parameters: (byte[] in, int length)
focal_class.return: byte[]
focal_class.signature: byte[] copyOf(byte[] in, int length)
focal_class.class_method_signature: Utils.appendByte(byte[] bytes, byte b)
focal_class.full_signature: public static byte[] appendByte(byte[] bytes, byte b)
focal_class.identifier: appendByte
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, byte b)
focal_class.return: byte[]
focal_class.signature: byte[] appendByte(byte[] bytes, byte b)
focal_class.class_method_signature: Utils.parseAsHexOrBase58(String data)
focal_class.full_signature: public static byte[] parseAsHexOrBase58(String data)
focal_class.identifier: parseAsHexOrBase58
focal_class.modifiers: public static
focal_class.parameters: (String data)
focal_class.return: byte[]
focal_class.signature: byte[] parseAsHexOrBase58(String data)
focal_class.class_method_signature: Utils.isWindows()
focal_class.full_signature: public static boolean isWindows()
focal_class.identifier: isWindows
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isWindows()
focal_class.class_method_signature: Utils.formatMessageForSigning(String message)
focal_class.full_signature: public static byte[] formatMessageForSigning(String message)
focal_class.identifier: formatMessageForSigning
focal_class.modifiers: public static
focal_class.parameters: (String message)
focal_class.return: byte[]
focal_class.signature: byte[] formatMessageForSigning(String message)
focal_class.class_method_signature: Utils.checkBitLE(byte[] data, int index)
focal_class.full_signature: public static boolean checkBitLE(byte[] data, int index)
focal_class.identifier: checkBitLE
focal_class.modifiers: public static
focal_class.parameters: (byte[] data, int index)
focal_class.return: boolean
focal_class.signature: boolean checkBitLE(byte[] data, int index)
focal_class.class_method_signature: Utils.setBitLE(byte[] data, int index)
focal_class.full_signature: public static void setBitLE(byte[] data, int index)
focal_class.identifier: setBitLE
focal_class.modifiers: public static
focal_class.parameters: (byte[] data, int index)
focal_class.return: void
focal_class.signature: void setBitLE(byte[] data, int index)
focal_class.class_method_signature: Utils.sleep(long millis)
focal_class.full_signature: public static void sleep(long millis)
focal_class.identifier: sleep
focal_class.modifiers: public static
focal_class.parameters: (long millis)
focal_class.return: void
focal_class.signature: void sleep(long millis)
focal_class.class_method_signature: Utils.setMockSleep(boolean isEnable)
focal_class.full_signature: public static void setMockSleep(boolean isEnable)
focal_class.identifier: setMockSleep
focal_class.modifiers: public static
focal_class.parameters: (boolean isEnable)
focal_class.return: void
focal_class.signature: void setMockSleep(boolean isEnable)
focal_class.class_method_signature: Utils.passMockSleep()
focal_class.full_signature: public static void passMockSleep()
focal_class.identifier: passMockSleep
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void passMockSleep()
focal_class.class_method_signature: Utils.finishMockSleep()
focal_class.full_signature: public static void finishMockSleep()
focal_class.identifier: finishMockSleep
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void finishMockSleep()
focal_method.body: public static byte[] reverseBytes(byte[] bytes) {
          // We could use the XOR trick here but it's easier to understand if we don't. If we find this is really a
          // performance issue the matter can be revisited.
          byte[] buf = new byte[bytes.length];
          for (int i = 0; i < bytes.length; i++)
              buf[i] = bytes[bytes.length - 1 - i];
          return buf;
      }
focal_method.class_method_signature: Utils.reverseBytes(byte[] bytes)
focal_method.full_signature: public static byte[] reverseBytes(byte[] bytes)
focal_method.identifier: reverseBytes
focal_method.modifiers: public static
focal_method.parameters: (byte[] bytes)
focal_method.return: byte[]
focal_method.signature: byte[] reverseBytes(byte[] bytes)