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] // data = [plaintext, keyword]
// build char array, shifting via map and corresponding keyword letter and join to final results // build char array, shifting via map and corresponding keyword letter and join to final results
const cipher = [...data[0]] const cipher = [...data[0]]
.map((a, i) => .map((a, i) => {
(a === " " return a === " "
? 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(""); .join("");
return cipher === ans; return cipher === ans;
}, },