How to use the hy.core.language.range function in hy

To help you get started, we’ve selected a few hy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andelf / beijing-realtime-bus / bjgj.py View on Github external
def _hy_anon_fn_3():
            key_bytes = bytearray(hashlib.md5(self.key).hexdigest(), u'utf-8')
            ret_val = list(range(256L))
            k = 0L
            m = 0L
            for i in range(256L):
                k = (255L & ((k + key_bytes[m]) + ret_val[i]))
                [ret_val[i], ret_val[k]] = [ret_val[k], ret_val[i]]
                [ret_val[i], ret_val[k]]
                m = ((1L + m) % len(key_bytes))
            return ret_val
        return _hy_anon_fn_3()
github andelf / beijing-realtime-bus / bjgj.py View on Github external
def _hy_anon_fn_3():
            key_bytes = bytearray(hashlib.md5(self.key).hexdigest(), u'utf-8')
            ret_val = list(range(256L))
            k = 0L
            m = 0L
            for i in range(256L):
                k = (255L & ((k + key_bytes[m]) + ret_val[i]))
                [ret_val[i], ret_val[k]] = [ret_val[k], ret_val[i]]
                [ret_val[i], ret_val[k]]
                m = ((1L + m) % len(key_bytes))
            return ret_val
        return _hy_anon_fn_3()
github andelf / beijing-realtime-bus / bjgj.py View on Github external
def _hy_anon_fn_5():
            trans_table = self._make_translate_table()
            raw_bytes = bytearray(raw)
            ret_val = bytearray(len(raw_bytes))
            j = 0L
            k = 0L
            for i in range(len(raw_bytes)):
                k = (255L & (k + 1L))
                j = (255L & (j + trans_table[k]))
                [trans_table[j], trans_table[k]] = [trans_table[k], trans_table[j]]
                [trans_table[j], trans_table[k]]
                n = (255L & (trans_table[k] + trans_table[j]))
                ret_val[i] = (raw_bytes[i] ^ trans_table[n])
                ret_val[i]
            return str(ret_val)
        return _hy_anon_fn_5()