Use Md5.js and base64.js in Vue projects

Source: Internet
Author: User

I. Installing NPM install in the project root directory--save js-base64npm Install--save js-MD5. Import MD5 from in Project document' Js-md5 '; let Base64= Require (' js-base64 '). Base64; third, use Base64base64.encode in the project file (' Dankogai ');//zgfua29nywk=Base64.encode (' small dietary chuhatsu ');//5bcp6ao85by+Base64.encodeuri (' small dietary chuhatsu ');//5bcp6ao85by-Base64.decode (' zgfua29nywk= ');//DankogaiBase64.decode (' 5bcp6ao85by+ ');//Little Dietary Chuhatsu//note. decodeURI () is unnecessary since it accepts both flavorsBase64.decode (' 5bcp6ao85by-');//Little Dietary ChuhatsuMd5md5 (‘‘);//d41d8cd98f00b204e9800998ecf8427eMD5 (' The quick brown fox jumps over the lazy dog ');//9e107d9d372bb6826bd81d3542a419d6MD5 (' The quick brown fox jumps over the lazy dog. ');//e4d909c290d0fb1ca068ffaddf22cbd0//It also supports UTF-8 encodingMD5 (' Chinese ');//A7bac2239fcdcb3a067903d8077c4a07//It also supports byte ' Array ', ' uint8array ', ' ArrayBuffer 'MD5 ([]);//d41d8cd98f00b204e9800998ecf8427eMD5 (NewUint8array ([]));//d41d8cd98f00b204e9800998ecf8427e//Different OutputMD5 (");//d41d8cd98f00b204e9800998ecf8427eMd5.hex (");//d41d8cd98f00b204e9800998ecf8427eMd5.array (");//[212, 233, 217, 143, 0, 178, 4, 236, $9, A-to-the-.Md5.digest (");//[212, 233, 217, 143, 0, 178, 4, 236, $9, A-to-the-.Md5.arraybuffer (");//ArrayBufferMd5.buffer (");//ArrayBuffer, deprecated, this maybe confuse with Buffer in node. js. Please use ArrayBuffer instead.

Use Md5.js and base64.js in Vue projects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.