cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [08/26] js commit: Android: base64.toArrayBuffer to convert base64 strings
Date Wed, 07 Jan 2015 01:27:07 GMT
Android: base64.toArrayBuffer to convert base64 strings


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/6fde14b8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/6fde14b8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/6fde14b8

Branch: refs/heads/3.7.x
Commit: 6fde14b81988b1eb118c42f47cbdfbb08d756256
Parents: 227d83a
Author: Rui Zhao <oahziur@gmail.com>
Authored: Thu Dec 11 17:13:48 2014 -0500
Committer: Rui Zhao <oahziur@gmail.com>
Committed: Thu Dec 11 17:13:48 2014 -0500

----------------------------------------------------------------------
 src/android/exec.js | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6fde14b8/src/android/exec.js
----------------------------------------------------------------------
diff --git a/src/android/exec.js b/src/android/exec.js
index 856bd8e..87cd52c 100644
--- a/src/android/exec.js
+++ b/src/android/exec.js
@@ -194,12 +194,7 @@ function buildPayload(payload, message) {
         payload.push(+message.slice(1));
     } else if (payloadKind == 'A') {
         var data = message.slice(1);
-        var bytes = window.atob(data);
-        var arraybuffer = new Uint8Array(bytes.length);
-        for (var i = 0; i < bytes.length; i++) {
-            arraybuffer[i] = bytes.charCodeAt(i);
-        }
-        payload.push(arraybuffer.buffer);
+        payload.push(base64.toArrayBuffer(data));
     } else if (payloadKind == 'S') {
         payload.push(window.atob(message.slice(1)));
     } else if (payloadKind == 'M') {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message