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

Class GB2312DistributionAnalysis

thirdparty/chardet/chardistribution.py:151–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149
150
151class GB2312DistributionAnalysis(CharDistributionAnalysis):
152 def __init__(self):
153 super(GB2312DistributionAnalysis, self).__init__()
154 self._char_to_freq_order = GB2312_CHAR_TO_FREQ_ORDER
155 self._table_size = GB2312_TABLE_SIZE
156 self.typical_distribution_ratio = GB2312_TYPICAL_DISTRIBUTION_RATIO
157
158 def get_order(self, byte_str):
159 # for GB2312 encoding, we are interested
160 # first byte range: 0xb0 -- 0xfe
161 # second byte range: 0xa1 -- 0xfe
162 # no validation needed here. State machine has done that
163 first_char, second_char = byte_str[0], byte_str[1]
164 if (first_char >= 0xB0) and (second_char >= 0xA1):
165 return 94 * (first_char - 0xB0) + second_char - 0xA1
166 else:
167 return -1
168
169
170class Big5DistributionAnalysis(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…