Update codingcontracttypes.ts

prettier
This commit is contained in:
Markus-D-M 2022-05-25 21:27:58 +02:00
parent 699d792e5b
commit 51ba358464

@ -1833,11 +1833,11 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
// data = [plaintext, keyword]
// build char array, shifting via map and corresponding keyword letter and join to final results
const cipher = [...data[0]]
.map((a, i) =>
(a === " "
.map((a, i) => {
return a === " "
? a
: String.fromCharCode(((a.charCodeAt(0) - 2 * 65 + data[1].charCodeAt(i % data[1].length)) % 26) + 65)),
)
: String.fromCharCode(((a.charCodeAt(0) - 2 * 65 + data[1].charCodeAt(i % data[1].length)) % 26) + 65);
})
.join("");
return cipher === ans;
},