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

Class EUCKRDistributionAnalysis

thirdparty/chardet/chardistribution.py:132–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130
131
132class EUCKRDistributionAnalysis(CharDistributionAnalysis):
133 def __init__(self):
134 super(EUCKRDistributionAnalysis, self).__init__()
135 self._char_to_freq_order = EUCKR_CHAR_TO_FREQ_ORDER
136 self._table_size = EUCKR_TABLE_SIZE
137 self.typical_distribution_ratio = EUCKR_TYPICAL_DISTRIBUTION_RATIO
138
139 def get_order(self, byte_str):
140 # for euc-KR encoding, we are interested
141 # first byte range: 0xb0 -- 0xfe
142 # second byte range: 0xa1 -- 0xfe
143 # no validation needed here. State machine has done that
144 first_char = byte_str[0]
145 if first_char >= 0xB0:
146 return 94 * (first_char - 0xB0) + byte_str[1] - 0xA1
147 else:
148 return -1
149
150
151class GB2312DistributionAnalysis(CharDistributionAnalysis):

Callers 2

__init__Method · 0.85
__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…