mirror of
https://github.com/nzp-team/QCHashTableGenerator.git
synced 2024-11-21 11:31:24 +00:00
Whoops, this is for IBM 3740 (stupid Id)
This commit is contained in:
parent
92c38a2a4f
commit
c4e3a4801b
2 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
# (FTE-)QuakeC Hash Table Generator
|
# (FTE-)QuakeC Hash Table Generator
|
||||||
|
|
||||||
`QCHashTableGenerator` is a simple utility designed to take in `.CSV` input files and generate an FTEQCC-compilable hash table structure, hashed using XMODEM CRC16. The overall goal is to ease compute time by mitigating the overall amount of string comparisons your QuakeC project may perform.
|
`QCHashTableGenerator` is a simple utility designed to take in `.CSV` input files and generate an FTEQCC-compilable hash table structure, hashed using IBM 3740 CRC16. The overall goal is to ease compute time by mitigating the overall amount of string comparisons your QuakeC project may perform.
|
||||||
|
|
||||||
It makes the assumption that the first value in your input `.CSV` is the value you want to hash. Given this example, `old_path` will be replaced with a generated hash:
|
It makes the assumption that the first value in your input `.CSV` is the value you want to hash. Given this example, `old_path` will be replaced with a generated hash:
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ Nazi Zombies: Portable QuakeC CRC generator
|
||||||
|
|
||||||
Takes input .CSV files and outputs an FTEQCC-compilable
|
Takes input .CSV files and outputs an FTEQCC-compilable
|
||||||
QuakeC struct with its contents, always assumes the first
|
QuakeC struct with its contents, always assumes the first
|
||||||
entry should be XMODEM CRC16 hashed, adding its length
|
entry should be IBM 3740 CRC16 hashed, adding its length
|
||||||
as an entry as well, for collision detection.
|
as an entry as well, for collision detection.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ def read_csv_data():
|
||||||
for value in csv_data.values:
|
for value in csv_data.values:
|
||||||
original_lengths.append(len(value[0]))
|
original_lengths.append(len(value[0]))
|
||||||
original_names.append(value[0])
|
original_names.append(value[0])
|
||||||
value[0] = int(crc16.xmodem(str.encode(value[0])))
|
value[0] = int(crc16.ibm_3740(str.encode(value[0])))
|
||||||
|
|
||||||
# Now order everything by ascending order
|
# Now order everything by ascending order
|
||||||
csv_data = csv_data.sort_values(csv_data.columns[0])
|
csv_data = csv_data.sort_values(csv_data.columns[0])
|
||||||
|
@ -155,7 +155,7 @@ def fetch_cli_arguments():
|
||||||
Initiates ArgParser with all potential command line arguments.
|
Initiates ArgParser with all potential command line arguments.
|
||||||
'''
|
'''
|
||||||
global args
|
global args
|
||||||
parser = argparse.ArgumentParser(description='XMODEM CRC16 hash generator in FTE QuakeC-readable data structure.')
|
parser = argparse.ArgumentParser(description='IBM 3740 CRC16 hash generator in FTE QuakeC-readable data structure.')
|
||||||
parser.add_argument('-i', '--input-file',
|
parser.add_argument('-i', '--input-file',
|
||||||
help='.CSV input file to parse.', required=True)
|
help='.CSV input file to parse.', required=True)
|
||||||
parser.add_argument('-o', '--output-file',
|
parser.add_argument('-o', '--output-file',
|
||||||
|
|
Loading…
Reference in a new issue