Skip to content

cartory/enCoderr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

version GitHub license

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

javascript love

Authors

MelissaSanchez20 karisZoe cartory GaboAP Erick328 milemf99

See also the list of contributors who participated in this project.