Skip to content

Commit

Permalink
[#638]system.cipher CRC32 异常 (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianbo-oppo authored Dec 25, 2023
1 parent 7664fed commit 0d0ebb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void crc32(Request request) throws Exception {
return;
}
String content = jsonParams.getString(PARAM_CONTENT);
int result = DigestUtils.crc32(content.getBytes(StandardCharsets.UTF_8));
long result = DigestUtils.crc32(content.getBytes(StandardCharsets.UTF_8));
JSONObject data = new JSONObject();
data.put(PARAM_TEXT, result);
request.getCallback().callback(new Response(data));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public static String getMd5(byte[] data) {
return hashString.toLowerCase();
}

public static int crc32(byte[] content) {
public static long crc32(byte[] content) {
try {
final CRC32 CRC32 = new CRC32();
CRC32.reset();
CRC32.update(content);
return (int) CRC32.getValue();
return CRC32.getValue();
} catch (Exception e) {
Log.e(TAG, "crc32 algorithm fail.", e);
}
Expand Down

0 comments on commit 0d0ebb4

Please sign in to comment.