Skip to content

Commit

Permalink
Improve the servicesignature performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
huiguangjun committed Feb 15, 2023
1 parent 6dfc15a commit 3b1b2f1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,11 @@ public String computeSignature(String key, String data) {
public byte[] computeHash(byte[] key, byte[] data) {
return sign(key, data, macInstance, LOCK, ALGORITHM);
}

static {
try {
macInstance = Mac.getInstance(ALGORITHM);
} catch (Throwable e) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,11 @@ public String computeSignature(String key, String data) {
public byte[] computeHash(byte[] key, byte[] data) {
return sign(key, data, macInstance, LOCK, ALGORITHM);
}

static {
try {
macInstance = Mac.getInstance(ALGORITHM);
} catch (Throwable e) {
}
}
}

0 comments on commit 3b1b2f1

Please sign in to comment.