mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-18 08:02:56 -04:00
Added reverse string lookup for CRCs in CRC
This commit is contained in:
@@ -29,6 +29,9 @@ package resources.common;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import resources.client_info.ClientFactory;
|
||||
import resources.client_info.visitors.CrcStringTableData;
|
||||
|
||||
public class CRC {
|
||||
|
||||
private static final int CRC_TABLE[] = {
|
||||
@@ -131,7 +134,11 @@ public class CRC {
|
||||
0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
||||
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
|
||||
};
|
||||
|
||||
|
||||
public static String getStringFromCrc(int crc) {
|
||||
return ((CrcStringTableData) ClientFactory.getInfoFromFile("misc/object_template_crc_string_table.iff")).getTemplateString(crc);
|
||||
}
|
||||
|
||||
public static int getCrc(String input) {
|
||||
byte [] bytes = input.getBytes(StandardCharsets.UTF_8);
|
||||
int crc = 0xffffffff;
|
||||
|
||||
Reference in New Issue
Block a user