Guest User

Untitled

a guest
Aug 25th, 2019
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function response(room, msg, sender, isGroupChat, replier, ImageDB) {
  2. if (msg.indexOf("!암호화 ") == 0){
  3. var data = msg.split(" ");
  4. if (data[1] = 1){
  5. if (data.length == 4){
  6. var data2, data3;
  7. for (var order = 2; order < 3; order++){
  8. var a = [];
  9. var abin = [];
  10. for (var i = 0; i<data[2].length; i++){
  11. a.push(data[order][i].charCodeAt());
  12. abin.push([]);
  13. var temp = a[i];
  14. for (var j = 0; j<8; j++){
  15. abin[i].push(temp%2);
  16. temp = Math.floor(temp/2);
  17. }
  18. }
  19. if (order == 2){
  20. data2 = abin;
  21. } else if (order == 3){
  22. data3 = abin;
  23. data3len = data3len.length;
  24. while (data2.length > data3.length){
  25. data3.push(data3[Math.floor(data3.length/data3len)]);
  26. }
  27. }
  28. }
  29. var resurtbin = [], resurt;
  30. for (var i=0; i<data2.length; i++){
  31. var k = 0;
  32. resurtbin.push([]);
  33. for (var j=0; j<8; j++){
  34. resurtbin[i].push((data2[i][j] + data3[i][j]) % 2);
  35. k += resultbin[i][j] * Math.pow(2,7-j);
  36. }
  37. result = result + String.formCharCode(k);
  38. }
  39. replier.reply(result);
  40. }
  41. }
  42. }
  43. }
RAW Paste Data