Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

字符串加密(转换成图片的base64码) #91

Open
mishe opened this issue Jan 27, 2016 · 0 comments
Open

字符串加密(转换成图片的base64码) #91

mishe opened this issue Jan 27, 2016 · 0 comments

Comments

@mishe
Copy link
Owner

mishe commented Jan 27, 2016

字符串加密(转换成图片的base64码)

本方案的基础是需要浏览器支持canvas。

使用方法

转换为图片

var str=JSON.stringify({a:'中文',b:'sss'}),
    str2=compressor.compress(str)
    console.log(str2)

还原字符串

compressor.decompressImage(str2,function(d){
    console.log(JSON.parse(d).a)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant