synodriver / pytea

New implementation at https://github.com/synodriver/ftea
GNU General Public License v3.0
11 stars 0 forks source link

pip安装的直接Example的代码跑不起来 #2

Closed maokecheng closed 2 years ago

maokecheng commented 2 years ago

tea = pytea.TEA(secret_key=bytes(16), encrypt_times=16)
TypeError: init() got an unexpected keyword argument 'secret_key'

any idea?

synodriver commented 2 years ago

版本有吗?是rc版本?

synodriver commented 2 years ago

别用kw参数呢?

synodriver commented 2 years ago

是Cython编译优化问题。Cython为了优化,默认不允许kw参数,参见这个问题 所以,改成

tea = pytea.TEA(bytes(16))
synodriver commented 2 years ago

另外可以试试action的cdivision分支的最新版,根据cython的说法,这样要快一些,但是在benchmark中并没有发现有显著的提升,因此,0.2.0rc1主要是修复了全局key的历史遗留问题,同时让速度有了更大的提升:达到了py版本的370倍速度

synodriver commented 2 years ago

我懂了,安装指令是pip install pytea2,因为我名字被抢了(

synodriver commented 2 years ago

Consider resolved, close.