danguer / blog-examples Goto Github PK
View Code? Open in Web Editor NEWBlog Examples
Home Page: http://blog.danguer.com
License: BSD 2-Clause "Simplified" License
Blog Examples
Home Page: http://blog.danguer.com
License: BSD 2-Clause "Simplified" License
It seems to me there is a bug in the base64 decode.
How could (enc3 == 64) on line 88, since you removed all paddings on line 59?
enc3 can never be 64 so that check seems unnecessary.
Similarly, the line
enc4 = this._keyStr.indexOf(input.charAt(j++));
seems wrong. If j>input.length, then input.charAt() = "" and indexOf("") =0, which is wrong since indexOf("A") = 0 as well. But your code works because in this case, i is already equal to bytes, so writing to uarray[i+1] writes outside of the actual array so it adds no new characters there.
blog-examples/js/base64-binary.js
Line 88 in 7614928
I'm trying to use your script to decode canvas data in android and get the subject error. I'm reading that this is not supported in Android 2.3.
Is there any known workaround?
I read issue #2 which was asking about removing decodeArrayBuffer
. After reading your answer what's its purpose is still not clear to me. It returns an array with size always divisible by 3, which I don't understand if it is by design or a bug: please clarify.
at lines 53, 54
var lkey1 = this._keyStr.indexOf(input.charAt(input.length-1));
var lkey2 = this._keyStr.indexOf(input.charAt(input.length-1));
surely line 54 should read
var lkey2 = this._keyStr.indexOf(input.charAt(input.length-2));
as there can be two pad characters at positions length -1 and length -2
http://blog.danguer.com/2011/10/24/base64-binary-decoding-in-javascript/
So,I decide to stat it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.