Saturday, December 1, 2012

MySQL PASSWORD() function in JavaScript


If you need to implement a MySQL PASSWORD() function in JavaScript - use http://code.google.com/p/crypto-js/#SHA-1 with 2 encodings.

Here is an example:

var password = "TestPassword";
var result = ("*"+CryptoJS.SHA1(CryptoJS.SHA1(password))).toUpperCase();
console.log("result : " + result);

Result will be *0F437A73F4E4014091B7360F60CF81271FB73180. If you check it with MySQL password() it will be the same:

mysql> select password("TestPassword") as result;
+-------------------------------------------+
| result                                    |
+-------------------------------------------+
| *0F437A73F4E4014091B7360F60CF81271FB73180 |
+-------------------------------------------+

24 comments:

Pavel Co Ebele said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

siva said...

This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.
Thank you for this blog. This for very interesting and useful.
Java training in Chennai
Java training in Bangalore
Java online training
Java training in Pune
Java training in Bangalore|best Java training in Bangalore

Madhu Balan said...

You have provided a nice article, Thank you very much for this one. And I hope this will be useful for many people. And I am waiting for your next post keep on updating these kinds of knowledgeable things
Java Training in Chennai
Java Training in Coimbatore
Java Training in Bangalore

gowsika said...

Pretty post,I hope your site useful for many users.
Air Hostess Training Institute in Bangalore
Best Aviation Academy in Bangalore
Airline and Airport Management Courses in Bangalore
Ground Staff Training in Bangalore
Airport Management Courses in Chennai
Ground Staff Training in Chennai
Air Hostess Academy in Chennai
Air Hostess Course in Mumbai
Best Aviation Academy in Chennai
Aviation Training Institutes in Bangalore

Riya Raj said...

Phenomenal Blog!!! thanks for your post and awaiting for your new updates...
Digital Marketing Course in Chennai
Digital Marketing Training in Chennai
Digital Marketing Training
Digital Marketing Course
Digital marketing course in Annanagar
Digital marketing course in vadapalani
Android training in Chennai
Python Training in Chennai
Big data training in chennai
JAVA Training in Chennai

shwethapriya said...

Nice blog was really feeling good to read it. Thanks for this information.
Spoken English Classes in Chennai
Best Spoken English Class in Chennai
German Classes in Chennai
pearson vue exam centers in chennai
Informatica MDM Training in Chennai
Hadoop Admin Training in Chennai
Spoken English Classes in Tnagar
Spoken English Classes in OMR

andriya said...

Nice article, its very informative content..thanks for sharing...Waiting for next update...
Drupal Training in Chennai
Drupal Training Course
Drupal 7 Certification
drupal training in vadapalani
drupal training in Guindy
Photoshop Classes in Chennai
clinical sas training in chennai
SAS Training in Chennai
javascript training in chennai
Hibernate Training in Chennai

andriya said...

Great Blog!!! Was an interesting blog with a clear concept. And will surely help many to update them.
RPA Training in Chennai
RPA course in Chennai
RPA Training Institute in Chennai
UiPath Training in Chennai
Blue Prism Training in Chennai
Machine Learning course in Chennai
RPA Training in Vadapalani
RPA Training in Thiruvanmiyur
RPA Training in Guindy
RPA Training in Anna Nagar

Anbarasan14 said...

I would like to thank the blog admin for sharing this useful information in my vision. I have been searching for this blog for a while.
Spoken English Classes in Chennai
Best Spoken English Classes in Chennai
IELTS Coaching in Chennai
IELTS Coaching Centre in Chennai
English Speaking Classes in Mumbai
English Speaking Course in Mumbai
IELTS Classes in Mumbai
IELTS Coaching in Mumbai
IELTS Coaching in Anna Nagar
Spoken English Class in Anna Nagar

priya rajesh said...

Great collection and thanks for sharing this info with us. Waiting for more like this.
Best AngularJS Training in Chennai
Angularjs Training institute in Chennai
AngularJS Training in Chennai
Angular 2 Training in Chennai
Angular 7 Training in Chennai
PHP Training in Chennai
Web Designing course in Chennai
AngularJS Training in Porur
AngularJS Training in Tambaram
AngularJS Training in Adyar

Reshma said...

Thanks For Sharing a wonderful post . It is really very helpful For Everyone ....
Php Training in velachery
Php Training in Anna nagar
Php Training in Tambaram
Php Training in T nagar
Php Training in Porur
Php Training in Adyar
Php Training in Vadapalani
Php Training in OMR
Php Training in Thiruvanmiyur

sasi said...

It's Looks deeply awesome article!! which you have posted is useful.
German Classes in anna nagar
German Language Course in Chennai
german classes in omr
AWS course in Chennai
Data Science Training in Chennai
German Classes in t nagar
ccna Training in Chennai
IELTS Coaching centre in Chennai

sasi said...

The concept you are saying is good. I was so happy after reading this article. Thankyou so much for good article.
Web Designing Course in chennai
Web Designing Course in bangalore
web designing course in coimbatore
web designing training in chennai
web designing training in madurai
Web Development courses in Chennai
web designing training institute in chennai
DOT NET Training in Bangalore

Reshma said...

Nice blog! Thanks for sharing this valuable information
Hacking Course in Chennai
Ethical hacking course in bangalore
Ethical hacking course in coimbatore
Ethical Hacking Training in Bangalore
Certified Ethical Hacking Course in Chennai
Ethical Hacking in Bangalore
Hacking Course in Bangalore
Ethical Hacking institute in Bangalore
Selenium Training in Bangalore
Software Testing course in Bangalore

Tuhin said...

keep up the good work. this is an Assam post. this to helpful, i have reading here all post. i am impressed. thank you. this is our digital marketing training center. This is an online certificate course
digital marketing training in bangalore | https://www.excelr.com/digital-marketing-training-in-bangalore

rocky said...

It is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well. Really very informative post.
python training in chennai

python online training in chennai

python training in bangalore

python training in hyderabad

python online training

python flask training

python flask online training

python training in coimbatore






Jayalakshmi said...

All the best for the upcoming articles. Thats all I are able to say. You most absolutely have built this blog website into something special.
data science training in chennai

data science training in tambaram

android training in chennai

android training in tambaram

devops training in chennai

devops training in tambaram

artificial intelligence training in chennai

artificial intelligence training in tambaram

Darshan Bhalerao said...

Nice content very helpful, It has a very important point which should be noted down. All points mentioned and very well written. Keep Posting & writing such content

AWS Online Training

Pathway for German Language said...

I am glad to post a worthy article about the German Language Course and IELTS Coaching from KCR consultants, this may change your career growth and language skill.
KCR CONSULTANTS
KCR CONSULTANTS

Tamil novels said...

Very useful article. Thanks for sharing with us.
Tamil novels pdf
Ramanichandran novels PDF
srikala novels PDF
Mallika manivannan novels PDF
muthulakshmi raghavan novels PDF
Infaa Alocious Novels PDF
N Seethalakshmi Novels PDF
Sashi Murali Tamil Novels

Boomerang Airplane said...

Much obliged for sharing this brilliant substance. its extremely fascinating. Numerous web journals I see these days don't actually give whatever pulls in others however the manner in which you have plainly clarified everything it's truly awesome. There are loads of posts But your method of Writing is so Good and Knowledgeable. continue to post such helpful data and view my site too...
How to make a paper airplane | Origami paper plane | Boomerang Airplane | how to make a eagle paper airplane | Best paper airplane design for distance and speed | Nakamura lock paper airplane
Eagle paper plane | Zazoom | Easy Freezy

Silent Girl said...

I'm for the essential time frame here. I found this board and I in finding It in reality obliging and it helped me out abundance. I'm needing to expertise something already and sponsorship happening others, for instance, you helped me.
Activate Office 2016 Crack

hubert said...

Photographs taken from the top floor using a Supreme IDimager Photo display precisely suited images because of primary.
https://thepcsoft.com/idimager-photo-supreme-crack/

novajasmine said...

Excellent post.
Bamini tamil font
Kurinji tamil font download
Aishwarya tamil font
Azhagi tamil font download
tau marutham tamil font download
Kalaham tamil font