-1

I came across this news yesterday when I open it, the title of the post shuffle like it's deciphering, after few seconds original titles appear. Here is the link: https://www.washingtonpost.com/graphics/2020/world/national-security/cia-crypto-encryption-machines-espionage/

Is it JavaScript?

Question is: If it's JavaScript how can fetch its code? How this function is working?

usman
  • 17
  • 2
  • I am a student and I am trying to learn things... idk asking this question was right or no? :/ – usman Feb 12 '20 at 16:51
  • found this answer, this will work for me... https://stackoverflow.com/questions/34569743/how-to-create-a-random-generated-alphabet-in-java – usman Feb 27 '20 at 08:45

2 Answers2

2

Here's a solution that uses randojs that will get you all the way there:

var finalString = "TOP SECRET";

function showScramble(){
  var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  document.getElementById("scrambled").innerHTML = randoSequence(characters).slice(0, Math.min(finalString.length - 1, characters.length - 1)).join("");
}

var runs = 1;
var scrambleInterval = setInterval(function(){
  if(++runs == 7){
    document.getElementById("scrambled").innerHTML = finalString;
    clearInterval(scrambleInterval);
  }
  else{
    showScramble();
  }
}, 200);
showScramble();
<script src="https://randojs.com/1.0.0.js"></script>
<h1 id="scrambled"></h1>
Aaron Plocharczyk
  • 2,776
  • 2
  • 7
  • 15
0

I found another solution I was looking for! :)

Generate random string/characters in JavaScript:

Generate random string/characters in JavaScript

usman
  • 17
  • 2