FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScript-ID3-Reader/src/base64.js at master · grender/JavaScript-ID3-Reader · GitHub
grender
/
JavaScript-ID3-Reader
Public
forked from
aadsm/JavaScript-ID3-Reader
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScript-ID3-Reader
/
src
/
base64.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (34 loc) · 1.08 KB
Breadcrumbs
JavaScript-ID3-Reader
/
src
/
base64.js
Copy path
File metadata and controls
43 lines (34 loc) · 1.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Modified version of http://www.webtoolkit.info/javascript-base64.html
(
function
(
ns
)
{
ns
.
Base64
=
{
// private property
_keyStr
:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
,
// public method for encoding
encodeBytes
:
function
(
input
)
{
var
output
=
""
;
var
chr1
,
chr2
,
chr3
,
enc1
,
enc2
,
enc3
,
enc4
;
var
i
=
0
;
while
(
i
<
input
.
length
)
{
chr1
=
input
[
i
++
]
;
chr2
=
input
[
i
++
]
;
chr3
=
input
[
i
++
]
;
enc1
=
chr1
>>
2
;
enc2
=
(
(
chr1
&
3
)
<<
4
)
|
(
chr2
>>
4
)
;
enc3
=
(
(
chr2
&
15
)
<<
2
)
|
(
chr3
>>
6
)
;
enc4
=
chr3
&
63
;
if
(
isNaN
(
chr2
)
)
{
enc3
=
enc4
=
64
;
}
else
if
(
isNaN
(
chr3
)
)
{
enc4
=
64
;
}
output
=
output
+
Base64
.
_keyStr
.
charAt
(
enc1
)
+
Base64
.
_keyStr
.
charAt
(
enc2
)
+
Base64
.
_keyStr
.
charAt
(
enc3
)
+
Base64
.
_keyStr
.
charAt
(
enc4
)
;
}
return
output
;
}
}
;
// Export functions for closure compiler
ns
[
"Base64"
]
=
ns
.
Base64
;
ns
.
Base64
[
"encodeBytes"
]
=
ns
.
Base64
.
encodeBytes
;
}
)
(
this
)
;
Back
|
FazBrowse Home
|
New Git URL