在javascript中加密邮件

在javascript中加密邮件

本文介绍了在javascript中加密邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法找到一种方法来获取用户输入并迭代我创建的各种库作为全局变量。

/ b>



我尝试过:



I am having trouble finding out a way to take the users input and iterate over a variety of libraries I have created as global variables.
/b>

What I have tried:

/*GLOBAL VARIABLES*/

/* asks for the code you will encrypt into*/
var CODE = readLine("Which code would you like to encode in? morse, tap, ascii, binary, phonetic, substitution, or decode (Pick One: lowercase, NO symbols)");

/*I want this to loop and ask for one character at a time to encrypt against the libraries.*/
var MESSAGE = readLine("Message(*UPPERCASE ONLY*): ");


/*FORMAT: SPACE A B C D E F G H I J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  1  2  3  4  5  6  7  8  9  0
   ARRAY:   0   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 34 35 36*/

//USED TO ASSIGN AN INDEX NUMBER TO MESSAGE BEING ENCODED, EX. CODE: morse, MESSAGE: A, INDEX: 1 RETURNS: ._
var MIDX = [" ", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
];


var MORSE = [" ", "._", "_...", "_._.", "_..", ".", ".._.", "__.", "....", "..", ".___", "_._", "._..", "__", "_.", "___", ".__.", "__._", "._.", "...", "_", ".._", "..._", ".__", "_.._", "_.__", "__..", ".____", "..___", "...__", "...._", ".....", "_....", "__...", "___..", "____.", "_____"
];

function start(){
   if(CODE == "morse"){
       var me = morseEncode();
       println(me);
   }else{
       println("Sorry, Code language selected is not a valid input. Please try again.");
       
       
       
   }
   
}
function morseEncode(){
    var encoded = [];
    for(var i = 0; i < .length; i++){
        
    }
    return encoded;
    
    
}

推荐答案


这篇关于在javascript中加密邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 18:13