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

Class EUCTWDistributionAnalysis

thirdparty/chardet/chardistribution.py:113–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112
113class EUCTWDistributionAnalysis(CharDistributionAnalysis):
114 def __init__(self):
115 super(EUCTWDistributionAnalysis, self).__init__()
116 self._char_to_freq_order = EUCTW_CHAR_TO_FREQ_ORDER
117 self._table_size = EUCTW_TABLE_SIZE
118 self.typical_distribution_ratio = EUCTW_TYPICAL_DISTRIBUTION_RATIO
119
120 def get_order(self, byte_str):
121 # for euc-TW encoding, we are interested
122 # first byte range: 0xc4 -- 0xfe
123 # second byte range: 0xa1 -- 0xfe
124 # no validation needed here. State machine has done that
125 first_char = byte_str[0]
126 if first_char >= 0xC4:
127 return 94 * (first_char - 0xC4) + byte_str[1] - 0xA1
128 else:
129 return -1
130
131
132class EUCKRDistributionAnalysis(CharDistributionAnalysis):

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…