MCPcopy Create free account
hub / github.com/sqlmapproject/sqlmap / EUCJPDistributionAnalysis

Class EUCJPDistributionAnalysis

thirdparty/chardet/chardistribution.py:217–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215
216
217class EUCJPDistributionAnalysis(CharDistributionAnalysis):
218 def __init__(self):
219 super(EUCJPDistributionAnalysis, self).__init__()
220 self._char_to_freq_order = JIS_CHAR_TO_FREQ_ORDER
221 self._table_size = JIS_TABLE_SIZE
222 self.typical_distribution_ratio = JIS_TYPICAL_DISTRIBUTION_RATIO
223
224 def get_order(self, byte_str):
225 # for euc-JP encoding, we are interested
226 # first byte range: 0xa0 -- 0xfe
227 # second byte range: 0xa1 -- 0xfe
228 # no validation needed here. State machine has done that
229 char = byte_str[0]
230 if char >= 0xA0:
231 return 94 * (char - 0xA1) + byte_str[1] - 0xa1
232 else:
233 return -1

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…