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

Class Big5DistributionAnalysis

thirdparty/chardet/chardistribution.py:170–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168
169
170class Big5DistributionAnalysis(CharDistributionAnalysis):
171 def __init__(self):
172 super(Big5DistributionAnalysis, self).__init__()
173 self._char_to_freq_order = BIG5_CHAR_TO_FREQ_ORDER
174 self._table_size = BIG5_TABLE_SIZE
175 self.typical_distribution_ratio = BIG5_TYPICAL_DISTRIBUTION_RATIO
176
177 def get_order(self, byte_str):
178 # for big5 encoding, we are interested
179 # first byte range: 0xa4 -- 0xfe
180 # second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe
181 # no validation needed here. State machine has done that
182 first_char, second_char = byte_str[0], byte_str[1]
183 if first_char >= 0xA4:
184 if second_char >= 0xA1:
185 return 157 * (first_char - 0xA4) + second_char - 0xA1 + 63
186 else:
187 return 157 * (first_char - 0xA4) + second_char - 0x40
188 else:
189 return -1
190
191
192class SJISDistributionAnalysis(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…