Giter Club home page Giter Club logo

Comments (3)

ifduyue avatar ifduyue commented on August 17, 2024

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.

ifduyue avatar ifduyue commented on August 17, 2024

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.

SimonSteinberger avatar SimonSteinberger commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.