superarts / KTPinBlock

A Kotlin implementation of PIN Block formats.
1 stars 0 forks source link

Add a website that calls APIs from ktpinblock to perform calculation #2

Open superarts opened 1 year ago

superarts commented 1 year ago

Explore the JSExport approach to call ktpinblock APIs from JavaScripts.

superarts commented 1 year ago

JS encoding example:

web/ktpinblock-coder # ./index.js

PAN: 1111222233334444
PIN: 1234
encoding...
iso0: 041226DDDCCCCBBB
iso1: 1412349835FD236F
iso2: 241234FFFFFFFFFF
iso3: 3412260FC111B8E1
superarts commented 1 year ago

Example JS file: https://github.com/superarts/KTPinBlock/blob/ab64e77496484b6e52cb606cf96535abc4df4aaf/web/ktpinblock-coder/index.js

The goal is to create a static GH page to console this JS file, but I may not have time to finish it before shutting down the project. For some reason, being asked to shutdown the project would be a really nice thing for me 🤞

superarts commented 1 year ago

Web encode demo is done here: https://www.superarts.org/KTPinBlock/

superarts commented 1 year ago

Web decoder has been added to https://www.superarts.org/KTPinBlock/ as well. Although my JS code is pretty terrible, it's a pretty cool POC that demonstrate how easy it is to export a KMM library to JS.

I'll add some self-comments in the PR to highlight the implementation details, please do check it out. Some information you find online might be outdated.