Giter VIP home page Giter VIP logo

Comments (5)

ar avatar ar commented on July 29, 2024

@mchhil-incomm at your convenience, please check f66f287 sent against next. If you think it solves the issue, we can back port it to master. I also took the opportunity to remove a few tests that would break with this change, but made no sense.

from jpos.

mchhil-incomm avatar mchhil-incomm commented on July 29, 2024

@ar  your protect0 is what I have implemented and is being used by other projects here internally. As for the protect method, I believe your test case covers it.

Should there be a test case to make sure results of protect0 and protect yield identical results?

from jpos.

ar avatar ar commented on July 29, 2024

Oh... protect0 was just placed as a reference while coding the protect :) — I'll take it away.

from jpos.

mchhil-incomm avatar mchhil-incomm commented on July 29, 2024

@ar The test case does not look right. For clarity you can try "=====^apr/apr^====^==="

   @Test
    public void testProtect10() throws Throwable {
        String result = ISOUtil.protect("=====^===========^====^===");
        assertEquals("=====^===========^====^===", result, "result");
    }

The name is not masked in it, unless its a special kind of track data that I am not aware of. The data after the first ^ has not changed because the following check

        if (firstSeparatorIndex < 6) {
            return s; // nothing to do
        }

The old method would have returned 

=====^___________^________

for an input of "=====^===========^====^==="

For regression, it would be good to test the old output equals the new one.

from jpos.

ar avatar ar commented on July 29, 2024

@mchhil-incomm the track1 "=====^apr/apr^====^===" looks invalid to me to start with. That would be a six digits card number, which looks invalid.

For regression, it would be good to test the old output equals the new one.
I think some of the old tests were just wrong, hence adjusted.

from jpos.

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.