Linux bear.hostingplus.cl 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
LiteSpeed
Server IP : 192.140.57.17 & Your IP : 216.73.216.106
Domains :
Cant Read [ /etc/named.conf ]
User : explo
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
bitninja-threat-hunting /
node_modules /
ebg13 /
Delete
Unzip
Name
Size
Permission
Date
Action
bin
[ DIR ]
drwxr-xr-x
2024-07-04 08:39
keys
[ DIR ]
drwxr-xr-x
2024-07-04 08:39
.eslintrc.js
729
B
-rw-r--r--
2024-07-01 08:57
.npmignore
27
B
-rw-r--r--
2024-07-01 08:57
.travis.yml
856
B
-rw-r--r--
2024-07-01 08:57
README.md
3.12
KB
-rw-r--r--
2024-07-01 08:57
index.js
648
B
-rw-r--r--
2024-07-01 08:57
index.spec.js
2.94
KB
-rw-r--r--
2024-07-01 08:57
package.json
1.7
KB
-rw-r--r--
2024-07-01 08:57
Save
Rename
const rot13 = require('./index'); describe('rot13', () => { describe('when using defaults', () => { it('should encode a string using rot13 by default', () => { const secretMessage = 'Secret Message'; const expected = 'Frperg Zrffntr'; const actual = rot13(secretMessage); expect(expected).toBe(actual); }); it('should decode a string using rot13 by default', () => { const secretMessage = 'Secret Message'; const encodedMessage = rot13(secretMessage); const decodedMessage = rot13(encodedMessage); expect(decodedMessage).toBe(secretMessage); }); }); describe('when using an assymetric key', () => { it('should encode a string using caesar cipher when using a key', () => { const secretMessage = 'Secret Message'; const expected = 'Eqodqf Yqeemsq'; const actual = rot13(secretMessage, 12); expect(expected).toBe(actual); }); it('should decode a string using caesar cipher when using a key', () => { const secretMessage = 'Secret Message'; const encodedMessage = rot13(secretMessage, 12); const decodedMessage = rot13(encodedMessage, 14); expect(decodedMessage).toBe(secretMessage); }); }); describe('when using non alphabetic chars', () => { describe('when message is not a string', () => { it('should return an empty string', () => { expect(rot13(null)).toBe(''); expect(rot13()).toBe(''); expect(rot13(undefined)).toBe(''); expect(rot13({})).toBe(''); expect(rot13([])).toBe(''); expect(rot13(true)).toBe(''); expect(rot13(123)).toBe(''); }); }); describe('when message contains numbers', () => { it('should not encode the numbers in the message', () => { const secretMessage = 'Secret Message 123'; const expectedEncoded = 'Frperg Zrffntr 123'; const encodedMessage = rot13(secretMessage); const decodedMessage = rot13(encodedMessage); expect(encodedMessage).toBe(expectedEncoded); expect(decodedMessage).toBe(secretMessage); }); }); describe('when message contains symbols', () => { it('should not encode the symbols in the message', () => { const secretMessage = 'Secret Message %^&*('; const expectedEncoded = 'Frperg Zrffntr %^&*('; const encodedMessage = rot13(secretMessage); const decodedMessage = rot13(encodedMessage); expect(encodedMessage).toBe(expectedEncoded); expect(decodedMessage).toBe(secretMessage); }); }); describe('when message is empty string', () => { it('should not change the string at all', () => { const secretMessage = ''; const expectedEncoded = ''; const encodedMessage = rot13(secretMessage); const decodedMessage = rot13(encodedMessage); expect(encodedMessage).toBe(expectedEncoded); expect(decodedMessage).toBe(secretMessage); }); }); }); });