Git Product home page Git Product logo

Comments (4)

codebude avatar codebude commented on August 24, 2024

Could you please try to set the forceUtf8 parameter in the createQRCode method to true and tell me if this solves your problems.

from qrcoder.

chenghuaiyu avatar chenghuaiyu commented on August 24, 2024

I've solved the problem. It's the bug in function CalculateECCWords(). the reason is the leading polyitem's coefficent is zero in some case, removing this item lead to the item count less than

eccWords, then continue doing XORs cause the final leadTermSource's last exponent is less than 0, so the wrong ECCWords are returned. The simple solution is appending an zero coefficient item in last position when removing the leading zero coefficient item. following is the code snippet.

        for (var i = 0; (leadTermSource.PolyItems.Count > 0 && leadTermSource.PolyItems[leadTermSource.PolyItems.Count-1].Exponent > 0); i++)
        {
            if (leadTermSource.PolyItems[0].Coefficient == 0)
            {   
                leadTermSource.PolyItems.RemoveAt(0);
                leadTermSource.PolyItems.Add(new PolynomItem(0, leadTermSource.PolyItems[leadTermSource.PolyItems.Count - 1].Exponent - 1));
            }
            else
            {
                var resPoly = this.MultiplyGeneratorPolynomByLeadtermCoefficient(generatorPolynom, this.GetAlphaExpFromIntVal(leadTermSource.PolyItems[0].Coefficient), i);
                resPoly = this.ConvertToDecNotation(resPoly);
                resPoly = this.XORPolynoms(leadTermSource, resPoly);
                leadTermSource = resPoly;
            }
        }

from qrcoder.

codebude avatar codebude commented on August 24, 2024

Reopened, so that I don't forget to implement and merge it.

from qrcoder.

codebude avatar codebude commented on August 24, 2024

Fixed in bafdd1f

from qrcoder.

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.