Commit 63617c4d authored by Josh Ji's avatar Josh Ji

log consumed time

parent 3db9e7bf
......@@ -36,10 +36,13 @@ public class RESTfulApi {
jdbcTemplate.execute("set @zero=unhex('00000000000000000000000000000000')");
String sql_query_by_hmac ="select * from identities " +
"where ?=aes_encrypt(unhex(sha2(concat(unhex(hex(idx)),aes_decrypt(?, sharedsecret, @zero)), 256)), sharedsecret, @zero);";
long t1 = System.currentTimeMillis();
List<Map<String, Object>> list =
jdbcTemplate.queryForList(sql_query_by_hmac,
new Object[]{Base64Utils.decodeFromString(identityRequest.HMAC_base64), Base64Utils.decodeFromString(identityRequest.Cx_base64)},
new int[]{Types.VARBINARY, Types.VARBINARY});
long t2 = System.currentTimeMillis();
logger.info("time consumed: {}", t2-t1);
list.forEach(map->{
map.forEach((k, v)->{
logger.info("{}: {}", k, v instanceof byte[]?HexUtils.toHexString((byte[])v):v);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment