Sha256: 45194395089c79e0d4abaef773adc58605bbbb7e3024a1c61c55b1f911033ffa

Contents?: true

Size: 955 Bytes

Versions: 6

Compression:

Stored size: 955 Bytes

Contents

<html>
<head>
<script src="base64.js" type="text/javascript"></script>
<title>base64 encode speeed</title>
</head>
<body>
<pre>
<script>
var t0 = Date.now();
for (var i = 0; i < 10000; ++i) {
base64.encode('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/');
}
document.writeln("JS encode: " + (Date.now() - t0));

if (window.btoa) {
var t0 = Date.now();
for (var i = 0; i < 10000; ++i) {
window.btoa('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/');
}
document.writeln("Native encode: " + (Date.now() - t0));
}


var x = base64.encode('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/');

var t0 = Date.now();
for (var i = 0; i < 10000; ++i) {
base64.decode(x);
}
document.writeln("JS decode: " + (Date.now() - t0));


if (window.atob) {
var t0 = Date.now();
for (var i = 0; i < 10000; ++i) {
window.atob(x);
}
document.writeln("Native decode: " + (Date.now() - t0));
}
</script>
</pre>
</body>
</html>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffi-hydrogen-0.1.5 vendor/stringencoders/javascript/base64-speed.html
ffi-hydrogen-0.1.4 vendor/stringencoders/javascript/base64-speed.html
ffi-hydrogen-0.1.3 vendor/stringencoders/javascript/base64-speed.html
ffi-hydrogen-0.1.2 vendor/stringencoders/javascript/base64-speed.html
ffi-hydrogen-0.1.1 vendor/stringencoders/javascript/base64-speed.html
ffi-hydrogen-0.1.0 vendor/stringencoders/javascript/base64-speed.html