forked from covalence-io/interview-prep-challenges
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (30 loc) · 1.13 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function encoderRing(string) {
// After making the decoderRing function to catch spam emails in your new awesome filter, you must now create an encoder to test it out.
// You are given the same translation table of all the homoglyphs to test out, and a string argument for which you need to substitute characters when applicable
// You must return the encoded string.
// EX: If given a string of "Click here to verify your account", a string like "Cӏìċκ һėrė tó ѵėrïfý ýöùr ạċċỏùոt" will be returned
const translationTable = {
a: ["à", "á", "ạ", "ą"],
c: ["ƈ", "ċ"],
d: ["ԁ", "ɗ"],
e: ["ẹ", "ė", "ė", "é", "è"],
g: ["ġ"],
h: ["һ"],
i: ["í", "ì", "ï"],
j: ["ј", "ʝ"],
k: ["κ"],
l: ["ӏ", "ḷ"],
n: ["ո"],
o: ["ȯ", "ỏ", "ơ", "ö", "ó", "ò"],
p: ["р"],
q: ["զ"],
s: ["ʂ"],
u: ["ü", "ú", "ù"],
v: ["ν", "ѵ"],
x: ["х", "ҳ"],
y: ["у", "ý"],
z: ["ʐ", "ż"]
};
return null;
}
module.exports = encoderRing;