* Constructor
()
| 59 | * Constructor |
| 60 | */ |
| 61 | constructor () { |
| 62 | super() |
| 63 | this.addSettings([ |
| 64 | { |
| 65 | name: 'variant', |
| 66 | type: 'enum', |
| 67 | value: defaultVariantName, |
| 68 | elements: variants.map(variant => variant.name), |
| 69 | labels: variants.map(variant => variant.label), |
| 70 | randomizable: false |
| 71 | }, |
| 72 | { |
| 73 | name: 'alphabet', |
| 74 | type: 'text', |
| 75 | value: alphabet, |
| 76 | uniqueChars: true, |
| 77 | blacklistChars: ' ', |
| 78 | minLength: 0, |
| 79 | maxLength: 25, |
| 80 | caseSensitivity: false |
| 81 | }, |
| 82 | { |
| 83 | name: 'key', |
| 84 | type: 'text', |
| 85 | value: 'cargo', |
| 86 | minLength: 2, |
| 87 | maxLength: 24, |
| 88 | caseSensitivity: false |
| 89 | } |
| 90 | ]) |
| 91 | |
| 92 | // Create internal Polybius square encoder instance |
| 93 | const variant = this.constructor.getVariant(defaultVariantName) |
| 94 | this._polybiusSquare = new PolybiusSquareEncoder() |
| 95 | this._polybiusSquare.setSettingValues({ |
| 96 | alphabet, |
| 97 | rows: variant.squarePositions, |
| 98 | columns: variant.squarePositions, |
| 99 | separator: '', |
| 100 | caseSensitivity: false, |
| 101 | includeForeignChars: false |
| 102 | }) |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Performs encode on given content. |
nothing calls this directly
no test coverage detected