Comments (3)
Yes, it's an incompatible change. But it is simpler than the previous ones.
If we renamed encrypt
into encrypt_raw
, and encrypt_hex
into encrypt
, it's another incompatible change.
So, maybe it is easier to change the app code, how do you think?
I know this may sound unfriendly, but sorry. And I will try to maintain backwards as possible as I can from now on.
from xxtea.
The core method of XXTEA, btea, operates on an array of int32. After calling btea, longs2bytes is called to convert the array into binary bytes. And we need another step, hexlify, to convert binary bytes into hex representation. According to this reason, it is natural that encrpyt
returns bytes, isn't it?
A good example to look at is hashlib, where digest
returns bytes, and hexdigest
returns hex.
Perl's [ECB](When I made this incompatible change, I was mimic Perl's [ECB]%28http://search.cpan.org/~appel/Crypt-ECB-1.40/ECB.pm%29 module APIs.) is an example, too.
from xxtea.
Hi ifduyue, we've already adapted our code, so that's not a problem. It was just a bit confusing and it seemed to us the other way around was more intuitive. I didn't realize hashlib was working similarly here. So, I think you're right :)
from xxtea.
Related Issues (20)
- Error when compiling on Windows / Py3 HOT 4
- Massiv CPU load on heavy usage sites HOT 22
- why the encrypt hex string is not the same with version 0.1 and 0.2 HOT 1
- Readme comparisons are incorrect for python 3.5. HOT 2
- Error installing on Windows 10 / Python 2.7.10 32 bit HOT 3
- Let users specify rounds HOT 1
- Support big-endian machine HOT 1
- decrypt not working ,return a blank string. HOT 3
- bytes count changes? C code can't decrypt HOT 4
- Error installing on Windows 10 / Python 2.7.12 32 bit HOT 2
- Value Error: Invalid data HOT 6
- Error installing xxtea on py 3.6+ HOT 2
- 与其它语言实现的无法兼容 HOT 1
- DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats HOT 5
- Wrong padding HOT 2
- Compilation failure on Windows for ARM HOT 2
- Port CI to github actions HOT 2
- Build Failiure on windows HOT 3
- xxtea update did not get pushed to pypi HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xxtea.