UNPKG

js-base64-extend

Version:

基于base64上扩展,增加设置key,支持node和浏览器端

41 lines (36 loc) 947 B
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script src="js-base64-extend-browser.min.js"></script> <script> jsBase64Extend.setCharsKey('a'); var str = jsBase64Extend.encode(JSON.stringify({ description: '可用于框架中和node配合使用', api: { time: new Date().getTime(), 'setCharsKey': { type: 'function', param: 'string', return: 'void', tips: '尽量设置值为A-z0-9+=/混合' }, 'encode': { type: 'function', param: 'string', return: 'string' }, 'decode': { type: 'function', param: 'string', return: 'string' }, } })); console.log(jsBase64Extend.decode(str)); </script> </body> </html>