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