> Markdown version of [/magazine/626-a-lightweight-text-scrambler-inspired-by-code100](https://www.wearedevelopers.com/magazine/626-a-lightweight-text-scrambler-inspired-by-code100). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # A Lightweight Text Scrambler Inspired by CODE100 **By:** [Daniel Cranney](https://www.wearedevelopers.com/@daniel-cranney) **Published:** September 4, 2025 # messagescramble: A Lightweight Text Scrambler Inspired by CODE100 Back at this years’ World Congress, Nimrod Kor took home the CODE100 trophy after providing a slick solution for our final challenge. We were so impressed by his approach, in fact, that Nimrod joined us to talk through his solution. With this in mind, the mastermind behind the challenge, our VP of DevRel Chris Heilmann decided to turn it into an [npm package called messagescramble](https://www.npmjs.com/package/messagescramble?activeTab=readme), providing a fun and easy way to _scramble_ and _unscramble_ text using a key sentence, making it perfect for puzzles or even lightweight obfuscation. ## How It Works - You provide a **key sentence**. - The package builds a **character-to-index map** from that key, so each letter is assigned a number. - `encode` turns your message into a sequence of numbers, with random letters for obfuscation. - `decode` reverses the process back to readable text, when the key is correct. ## A Quick Example // Import the package after installation import { encode, decode } from "messagescramble"; // The key we have used contains every letter of the alphabet const key = "the quick brown fox jumps over the lazy dog"; const message = "hello world"; // Encode const encoded = encode(message, key); console.log(encoded.message); // scrambled numbers // Decode const decoded = decode(encoded.message, key); console.log(decoded.message); // "hello world" ## Try It Yourself If you’d like to see the package in action, go and [check out the demo page](https://codepo8.github.io/messagescramble/), read more on the [npm site](https://www.npmjs.com/package/messagescramble?activeTab=readme) or simply run `npm i messagescramble` to install it and get going right away. ## Related Articles - [The CODE100 2025 Final Puzzle Explained](https://www.wearedevelopers.com/magazine/607-the-code100-2025-final-puzzle-explained) - [Dev Digest 111 - npm i -g issues](https://www.wearedevelopers.com/magazine/415-dev-digest-111-npm-i-g-issues) - [CODE100 Live Day challenge -"Scavenger Hunt" solution and winners](https://www.wearedevelopers.com/magazine/479-code100-live-day-challenge-scavenger-hunt-solution-and-winners) - [CODE100 - Could you have solved our coding challenges?](https://www.wearedevelopers.com/magazine/281-code100-could-you-have-solved-our-coding-challenges) ## Related Videos - [Capture the Flag 101](https://www.wearedevelopers.com/videos/416-capture-the-flag-101) - [Playing Games with CSS](https://www.wearedevelopers.com/videos/210-playing-games-with-css) - [How to Automate your Murder Mystery](https://www.wearedevelopers.com/videos/1273-how-to-automate-your-murder-mystery) - [WeAreDevelopers LIVE - CODE100 at WeAreDevelopers Europe](https://www.wearedevelopers.com/videos/2132-wearedevelopers-live-code100-at-wearedevelopers-europe) ## Related Jobs - [Junior Frontend Engineer](https://www.wearedevelopers.com/jobs/ext/1532351-junior-frontend-engineer) at **Almedia** - [Senior Full Stack Engineer](https://www.wearedevelopers.com/jobs/48289-senior-full-stack-engineer) at **Sensory-Minds GmbH** - [Remote Senior Full-Stack Engineer](https://www.wearedevelopers.com/jobs/ext/639235-remote-senior-full-stack-engineer) at **Edge Impulse** - [Remote Senior Full-Stack Engineer](https://www.wearedevelopers.com/jobs/ext/646086-remote-senior-full-stack-engineer) at **Edge Impulse** - [Remote Senior Full-Stack Engineer](https://www.wearedevelopers.com/jobs/ext/679408-remote-senior-full-stack-engineer) at **Edge Impulse** - [Remote Senior Full-Stack Engineer](https://www.wearedevelopers.com/jobs/ext/643342-remote-senior-full-stack-engineer) at **Edge Impulse**