我们从Python开源项目中,提取了以下17个代码示例,用于说明如何使用__builtin__.ord()。
def get_mac_address(ifname): import fcntl ifname = ifname[:15] if PY3: ifname = bytes(ifname, 'ascii') s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) with contextlib.closing(s): info = fcntl.ioctl( s.fileno(), SIOCGIFHWADDR, struct.pack('256s', ifname)) if PY3: def ord(x): return x else: import __builtin__ ord = __builtin__.ord return ''.join(['%02x:' % ord(char) for char in info[18:24]])[:-1]
def a01(t, token_error=False, is9Anime=False): i = 0 for e in range(0, len(t)): if token_error == False: if is9Anime == False: i += ord(t[e]) + e else: i += ord(t[e]) * e else: try: i += eval('ord(t[%s]) %s' % (e, TOKEN_OPER[0])) except: i += eval('ord(t[%s]) %s' % (e, TOKEN_OPER[1])) return i #6856
def ord(char): """Returns unicode id for utf8 or unicode *char* character SUPPOSE that *char* is an utf-8 or unicode character only """ if isinstance(char, unicode): return __builtin__.ord(char) return __builtin__.ord(unicode(char, 'utf-8'))
def ord(char): """ returns unicode id for utf8 or unicode *char* character SUPPOSE that *char* is an utf-8 or unicode character only """ if isinstance(char, unicode): return __builtin__.ord(char) return __builtin__.ord(unicode(char, 'utf-8'))
def r01(t, e, token_error=False): i = 0 n = 0 for i in range(0, max(len(t), len(e))): if i < len(e): n += ord(e[i]) if i < len(t): n += ord(t[i]) h = format(int(hex(n),16),'x') return h
def decode_t(t, i, is9Anime=False, **kwargs): n = [] e = [] r = '' if common.ENCRYPTED_URLS == False: return True, t try: if is9Anime == True: return decode_t2(t) for n in range(0, len(t)): if n==0 and t[n] == '.': pass else: c = ord(t[n]) if c >= 97 and c <= 122: e.append((c - 71 + i) % 26 + 97) elif c >= 65 and c <= 90: e.append((c - 39 + i) % 26 + 65) else: e.append(c) for ee in e: r += chr(ee) return True, r except Exception as e: Log("fmovies.py > decode_t > %s" % e) return False, 'Error in decoding val'
def cleanJSS1(str): if str == None: raise ValueError("cleanJSS: Token is None type") txt = str for i in range(0,len(str)): c = str[i] if (ord(c) <= 127 and c != '_'): pass else: txt = txt.replace(c, makeid(1)) return txt
def r01(self, t, e, token_error=False): i = 0 n = 0 for i in range(0, max(len(t), len(e))): if i < len(e): n += ord(e[i]) if i < len(t): n += ord(t[i]) h = format(int(hex(n),16),'x') return h
def a01(self, t, token_error=False): i = 0 for e in range(0, len(t)): if token_error == False: i += ord(t[e]) + e else: i += ord(t[e]) * e + e return i
def decode_t(self, t, i): n = [] e = [] r = '' if ENCRYPTED_URLS == False: return True, t try: for n in range(0, len(t)): if n == 0 and t[n] == '.': pass else: c = ord(t[n]) if c >= 97 and c <= 122: e.append((c - 71 + i) % 26 + 97) elif c >= 65 and c <= 90: e.append((c - 39 + i) % 26 + 65) else: e.append(c) for ee in e: r += chr(ee) return True, r except Exception as e: log('ERROR', 'decode_t','%s' % e, dolog=False) False, 'Error in decoding'