Can someone explain this javascript to me?

Hello, can someone explain how the value 8123 gets produced from this code?

eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('d=7;c=4;b=5;a=2;e=3;f=1;g=9;h=6;i=0;j=8;',20,20,'||||||||||t|p|u|x|y|o|||w|q'.split('|'),0,{}))

Open in new window

document.write(+q+o+t+y)  produces 8123
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:

Try and paste your js to beautify. It will generate following result:

x = 7;
u = 4;
p = 5;
t = 2;
y = 3;
o = 1;
g = 9;
h = 6;
w = 0;
q = 8;

Seems, this is just encrypted js so no one gets what is being cooked for a functionality.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
This seems more like a key to some encryption algorithm. when sorted it became - wotyuphxqg which doesn't make any sense.
linuxroxAuthor Commented:
yea it appears jsbeautifier produced the correct result.  i'm trying to figure out how to execute that javascript function either from or php.  basically i'm pulling that function from a remote site and i'd like to execute it from within a program of my own.  i don't want to have to use my web browser to execute the function....need to do it from within a program.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
I'm not sure about how would you able to do that in I think php will be able to execute it within browser.
linuxroxAuthor Commented:
yea i can get php to echo the results out to the browser...just wish there was a way for me to actually get the values without using a browser
RobOwner (Aidellio)Commented:
I'll take a look for you as it sounds like you just want this converted to a function you can use on php or whatever
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.