0.0.2 • Published 3 years ago
Encoderr
Algorithms Available
Encoding
Algorith Name | Alphabet | Param | returns | Requires |
---|
Caesar | a...z | number | string | number > 0 |
Vigenere | a...z | string | string | string !Empty |
Zigzag | a...z | number | string | number > 0 |
Mono Alphabet | a...z | alpha | string | alpha.length = Alphabet.length |
Series | a...z | none | object | none |
Row Transposition | a...z | string | string | string !Empty |
Column Transposition | a...z | string | string | string !Empty |
Decoding
Algorith Name | Alphabet | Param | returns | Requires |
---|
Caesar | a...z | number | string | number > 0 |
Vigenere | a...z | string | string | string !Empty |
Zigzag | a...z | number | string | number > 0 |
Mono Alphabet | a...z | alpha | string | alpha.length = Alphabet.length |
Series | a...z | none | string | encode First |
Row Transposition | a...z | string | string | string !Empty |
Column Transposition | a...z | string | string | string !Empty |
Example
import { encode, decode } from "encoderr";
let params = [
"abcdefghijklmnñopqrstuvwxyz",
"", // MESSAGE
"2", // PARAM ACCORDING ENCODING/DECODING
];
const example = {
encoding: ([alpha, text, moves]) => {
moves = Number.parseInt(moves);
if (!moves || moves < 1) return "Number Required";
return encode.caesarEncode(alpha, text, moves);
},
decoding: ([alpha, text, moves]) => {
moves = Number.parseInt(moves);
if (!moves || moves < 1) return "Number Required";
return encode.caesarEncode(alpha, text, moves);
},
};
params[1] = "hello world";
console.log("message => ", params[1]);
params[1] = example.encoding(params);
console.log("encoded => ", params[1]);
params[1] = example.decoding(params);
console.log("decoded => ", params[1]);
Built With
Authors
See also the list of contributors who participated in this project.