diff --git a/lib/main.js b/lib/main.js index 363334c..e1f21a6 100755 --- a/lib/main.js +++ b/lib/main.js @@ -172,7 +172,7 @@ class C { */ base64encode(str, urlFriendly){ if(!Buffer.isBuffer(str)) - str = Buffer.from(str) + str = Buffer.from(str + '') let encode = str.toString('base64') if(urlFriendly) encode = encode.replace(/[+\/]/g, m => {return m === '+' ? '-' : '_'}).replace(/=/g, '') diff --git a/package.json b/package.json index 852ad64..f0a7e09 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crypto.js", - "version": "1.0.0", + "version": "1.0.1", "description": "原生crypto加密模块的二次封装,简化常用加密函数的使用", "keywords": [ "md5",