Git Product home page Git Product logo

backmask's Introduction

BACKMASK

How to use: As the one argument to the program, pass in a string from roughly 10-100 characters long (in quotes, if not all one word).

This program will scan the string in reverse, and try to find satanic messages buried in it.

The idea is that you can find satanic messages in really anything, and if we were to program this for other sorts of messages, those would work too.

EXAMPLE

Here's an example run (using the default string - "Play Chess Online on the #1 Chess Site - Play with over 20 million members")

./bin/BackMask Input: Play Chess Online on the #1 Chess Site - Play with over 20 million members FINAL STRING: BELIAL PET IS HE HELL 351ms

So we got: BELIAL PET IS HE HELL (check it yourself) in 351ms of processing time.

./bin/BackMask "NYWYKHDHSXTLQSFHNZUMPHYQATXFXZPDNUKIKHVRMPJQNUSTIUEPMJGKUQAK" Input: NYWYKHDHSXTLQSFHNZUMPHYQATXFXZPDNUKIKHVRMPJQNUSTIUEPMJGKUQAK FINAL STRING: AM EVIL 197ms

The cool thing about the above run is that there were more possible traversals through the letters than there are atoms in the universe!

OPTIMIZATION

The program was optimized in a number of ways. A common strategy might be that each possible word is checked against a hash map/set to see if it is an actual word. This program uses a trie structure to be able to know for sure whether or not a letter sequence can possibly be continued (this is impossible with a hash map/set).

When assembling phrases we use the fact that we only use bigrams (as opposed to trigrams) to assume that we know the top score for a given word and all its previous words, so all we have to do is compute the current score with that word.

Because there are so many possible traversals through the letters, this program is multithreaded. There is a control in GlobalWorker.h as to how many threads. Also, when a word is found, each thread doesn't have to wait for a mutex until it gets to add to the results, since there's a container for each thread's results. This greatly saves time.

Recursion? This program uses recursion, and while the hope is that the compiler is optimizing this, a big TODO is to implement an iterative solution just in case.

backmask's People

Contributors

mmurphy42 avatar mmurphyspotx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.