Code Monkey home page Code Monkey logo

blog-examples's People

Contributors

danguer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blog-examples's Issues

Probably a bug

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.

if (enc3 != 64) uarray[i+1] = chr2;

Don`t use it: many errors in base64-binary.js

  1. line 44 and 56: var bytes = Math.ceil( (3*input.length) / 4.0);
    change to var bytes = (input.length/4) * 3;
    because input.length must be input.length % 4 = 0
  2. line 54 var lkey2 = this._keyStr.indexOf(input.charAt(input.length-1));
    change to var lkey2 = this._keyStr.indexOf(input.charAt(input.length-2));
    because you need to analyze two last characters
  3. Don`t understand why you need decodeArrayBuffer function, remove it and use decode

Unit8Array is not defined

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?

[Question] Working of decodeArrayBuffer: bug or by design?

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.

Possible bug in the handling of decode padding

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.