[aimedb] fix some card number causing overflow

pull/1/head
samnyan 2020-01-19 23:12:11 +08:00
parent 20422b130f
commit b0400c365c
1 changed files with 3 additions and 1 deletions

View File

@ -42,7 +42,9 @@ public class FeliCaLookupHandler implements BaseHandler {
// Get the decimal represent of the hex value, same from minime
StringBuilder accessCode = new StringBuilder(String.valueOf(((ByteBuf) requestMap.get("idm")).getLong(0)));
StringBuilder accessCode = new StringBuilder(
String.valueOf(((ByteBuf) requestMap.get("idm")).getLong(0)).replaceAll("-","") // Prevent negative overflow
);
while (accessCode.length() < 20) {
accessCode.insert(0, "0");
}