UNPKG

jspos

Version:

JavaScript ISO8583 ,JavaScript version of JPOS

65 lines (52 loc) 2.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * Implementations convert Strings into byte arrays and vice versa. * @author Sean sean.snow@live.com * @date 2015/12/24 */ var Interpreter = function () { function Interpreter() { _classCallCheck(this, Interpreter); } _createClass(Interpreter, [{ key: "interpret", /** * Converts the string data into a different interpretation. Standard * interpretations are ASCII, EBCDIC, BCD and LITERAL. * * @param data * @param byte * @param offset */ value: function interpret(data, byte, offset) {} /** * Converts the byte array into a String. This reverses the interpret * method. * * @param rawData * The interpreted data. * @param offset * The index in rawData to start interpreting at. * @param length * The number of data units to interpret. * @return String The uninterpreted data. */ }, { key: "uninterpret", value: function uninterpret(rawData, offset, length) {} /** * Returns the number of bytes required to interpret a String of length * nDataUnits. */ }, { key: "getPackedLength", value: function getPackedLength(nDataUnits) {} }]); return Interpreter; }(); exports.default = Interpreter;