@zxing/library
Version:
TypeScript port of ZXing multi-format 1D/2D barcode image processing library.
26 lines (25 loc) • 659 B
JavaScript
export default class DataCharacter {
constructor(value, checksumPortion) {
this.value = value;
this.checksumPortion = checksumPortion;
}
getValue() {
return this.value;
}
getChecksumPortion() {
return this.checksumPortion;
}
toString() {
return this.value + '(' + this.checksumPortion + ')';
}
equals(o) {
if (!(o instanceof DataCharacter)) {
return false;
}
const that = o;
return this.value === that.value && this.checksumPortion === that.checksumPortion;
}
hashCode() {
return this.value ^ this.checksumPortion;
}
}