parent
33e49c43ea
commit
e3aa7aeb72
|
@ -172,7 +172,7 @@ class C {
|
||||||
*/
|
*/
|
||||||
base64encode(str, urlFriendly){
|
base64encode(str, urlFriendly){
|
||||||
if(!Buffer.isBuffer(str))
|
if(!Buffer.isBuffer(str))
|
||||||
str = Buffer.from(str)
|
str = Buffer.from(str + '')
|
||||||
let encode = str.toString('base64')
|
let encode = str.toString('base64')
|
||||||
if(urlFriendly)
|
if(urlFriendly)
|
||||||
encode = encode.replace(/[+\/]/g, m => {return m === '+' ? '-' : '_'}).replace(/=/g, '')
|
encode = encode.replace(/[+\/]/g, m => {return m === '+' ? '-' : '_'}).replace(/=/g, '')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "crypto.js",
|
"name": "crypto.js",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "原生crypto加密模块的二次封装,简化常用加密函数的使用",
|
"description": "原生crypto加密模块的二次封装,简化常用加密函数的使用",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"md5",
|
"md5",
|
||||||
|
|
Loading…
Reference in New Issue