File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1010
1111 exports . encode = function ( arraybuffer ) {
1212 var bytes = new Uint8Array ( arraybuffer ) ,
13- i , len = bytes . buffer . byteLength , base64 = "" ;
13+ i , len = bytes . length , base64 = "" ;
1414
1515 for ( i = 0 ; i < len ; i += 3 ) {
16- base64 += chars [ bytes . buffer [ i ] >> 2 ] ;
17- base64 += chars [ ( ( bytes . buffer [ i ] & 3 ) << 4 ) | ( bytes . buffer [ i + 1 ] >> 4 ) ] ;
18- base64 += chars [ ( ( bytes . buffer [ i + 1 ] & 15 ) << 2 ) | ( bytes . buffer [ i + 2 ] >> 6 ) ] ;
19- base64 += chars [ bytes . buffer [ i + 2 ] & 63 ] ;
16+ base64 += chars [ bytes [ i ] >> 2 ] ;
17+ base64 += chars [ ( ( bytes [ i ] & 3 ) << 4 ) | ( bytes [ i + 1 ] >> 4 ) ] ;
18+ base64 += chars [ ( ( bytes [ i + 1 ] & 15 ) << 2 ) | ( bytes [ i + 2 ] >> 6 ) ] ;
19+ base64 += chars [ bytes [ i + 2 ] & 63 ] ;
2020 }
2121
2222 if ( ( len % 3 ) === 2 ) {
5656
5757 return arraybuffer ;
5858 } ;
59- } ) ( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ) ;
59+ } ) ( "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " base64-arraybuffer" ,
33 "description" : " Encode/decode base64 data into ArrayBuffers" ,
4- "version" : " 0.1.0 " ,
4+ "version" : " 0.1.1 " ,
55 "homepage" : " https://github.com/niklasvh/base64-arraybuffer" ,
66 "author" : {
77 "name" : " Niklas von Hertzen" ,
3232 "grunt" : " ~0.3.17"
3333 },
3434 "keywords" : []
35- }
35+ }
You can’t perform that action at this time.
0 commit comments