MCPcopy Create free account
hub / github.com/SeanDragon/protools / toInteger

Method toInteger

security/src/main/java/pro/tools/security/sm/SM3.java:157–165  ·  view source on GitHub ↗
(byte[] source, int index)

Source from the content-addressed store, hash-verified

155 }
156
157 private static int toInteger(byte[] source, int index) {
158 StringBuilder valueStr = new StringBuilder();
159 for (int i = 0; i < 4; i++) {
160 valueStr.append(hexDigits[(byte) ((source[index * 4 + i] & 0xF0) >> 4)]);
161 valueStr.append(hexDigits[(byte) (source[index * 4 + i] & 0x0F)]);
162 }
163 return Long.valueOf(valueStr.toString(), 16).intValue();
164
165 }
166
167 private static byte[] toByteArray(int a, int b, int c, int d, int e, int f,
168 int g, int h) throws IOException {

Callers 1

CFMethod · 0.95

Calls 2

intValueMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected