From 38ca59460091d6f419b0c02ba7670525e795d729 Mon Sep 17 00:00:00 2001 From: Aaron Schmidt Date: Wed, 30 Dec 2015 11:27:16 +1300 Subject: [PATCH] Putting (bits1 | bits2) expression into a variable Fixes iOS 6.x bug described here: https://code.google.com/p/crypto-js/issues/detail?id=80 --- src/enc-base64.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/enc-base64.js b/src/enc-base64.js index 25cc001..1d09ec9 100644 --- a/src/enc-base64.js +++ b/src/enc-base64.js @@ -90,7 +90,8 @@ if (i % 4) { var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2); var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2); - words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= (bitsCombined) << (24 - (nBytes % 4) * 8); nBytes++; } }