blueimp_md5
Since there is no md5 encryption function in native javascript, we have to borrow a js md5 encryption plugin hereblueimp_md5
-
Code link and tutorial https://github.com/clearbladeplatform/blueimp_md5
-
It can also be used
npm install blueimp_md5
to download
Simple to use
- Introduce in HTML file
<script src="js/md5.min.js"></script>
- In the application code, calculate the (hexadecimal code) md5 hash of the string by calling the md5 method with the string as a parameter
let hash = md5("value"); // "2063c1608d6e0baf80249c42e2be5804"
//当然我们也嵌套使用
let hash2 = md5(md5('value')); //"5d638088db991347a4403e4ee407a0f7"