123456789101112131415161718 |
- const CryptoJS = require('./crypot')
- const STR = 'XX#$%()(#*!()!KL<><MQLMNQNQJQK&sdfkjsdrow32234545fdf>?N<:{LWPW'
- function strToHexCharCode(str) {
- if(str === "")
- return "";
- var hexCharCode = [];
- hexCharCode.push("0x");
- for(var i = 0; i < str.length; i++) {
- hexCharCode.push((str.charCodeAt(i)).toString(16));
- }
- return hexCharCode.join("");
- }
- export function encryption (value) {
- const time = new Date().getTime()
- return CryptoJS.SHA256(`${value}${STR}${time}`).toString()
- }
|