This commit is contained in:
AJ ONeal 2014-05-20 09:03:48 -06:00
rodič 7294e5e787
revize 001cf59083
10 změnil soubory, kde provedl 6 přidání a 165 odebrání

Zobrazit soubor

@ -1,19 +1,4 @@
atob
===
MOVED
====
Uses `Buffer` to emulate the exact functionality of the browser's atob.
Note: Unicode may be handled incorrectly (like the browser).
It turns base64-encoded **a**scii data back **to** **b**inary.
(function () {
"use strict";
var atob = require('atob')
, b64 = "SGVsbG8gV29ybGQ="
, bin = atob(b64)
;
console.log(bin); // "Hello World"
}());
Now at https://github.com/node-browser-compat/atob

Zobrazit soubor

@ -1,10 +0,0 @@
#!/usr/bin/env node
/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true eqeqeq:true immed:true latedef:true*/
(function () {
"use strict";
var atob = require('../index')
;
console.log(atob(process.argv[2]));
}());

Zobrazit soubor

@ -1,9 +0,0 @@
(function () {
"use strict";
function atob(str) {
return new Buffer(str, 'base64').toString('binary');
}
module.exports = atob;
}());

Zobrazit soubor

@ -1,23 +0,0 @@
{
"name": "atob",
"homepage": "https://github.com/coolaj86/node-browser-compat",
"description": "atob for Node.JS and Linux / Mac / Windows CLI (it's a one-liner)",
"repository": {
"type": "git",
"url": "git://github.com/coolaj86/node-browser-compat.git"
},
"keywords": [
"atob",
"browser"
],
"author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.info)",
"engines": {
"node": ">= 0.4.0"
},
"main": "index",
"bin": {
"atob": "bin/atob.js"
},
"license": "Apache2",
"version": "1.1.0"
}

Zobrazit soubor

@ -1,20 +0,0 @@
/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true eqeqeq:true immed:true latedef:true*/
(function () {
"use strict";
var atob = require('./index')
, encoded = "SGVsbG8gV29ybGQ="
, unencoded = "Hello World"
/*
, encoded = "SGVsbG8sIBZM"
, unencoded = "Hello, 世界"
*/
;
if (unencoded !== atob(encoded)) {
console.log('[FAIL]', unencoded, atob(encoded));
return;
}
console.log('[PASS] all tests pass');
}());

Zobrazit soubor

@ -1,19 +1,4 @@
btoa
===
MOVED
====
Uses `Buffer` to emulate the exact functionality of the browser's btoa (except that it supports unicode and the browser may not).
It turns **b**inary data **to** base64-encoded **a**scii.
(function () {
"use strict";
var btoa = require('btoa')
, bin = "Hello, 世界"
, b64 = btoa(bin)
;
console.log(b64); // "SGVsbG8sIBZM"
}());
Note: Unicode may or may not be handled incorrectly.
Now at https://github.com/node-browser-compat/btoa

Zobrazit soubor

@ -1,10 +0,0 @@
#!/usr/bin/env node
/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true eqeqeq:true immed:true latedef:true*/
(function () {
"use strict";
var btoa = require('../index')
;
console.log(btoa(process.argv[2]));
}());

Zobrazit soubor

@ -1,18 +0,0 @@
(function () {
"use strict";
function btoa(str) {
var buffer
;
if (str instanceof Buffer) {
buffer = str;
} else {
buffer = new Buffer(str.toString(), 'binary');
}
return buffer.toString('base64');
}
module.exports = btoa;
}());

Zobrazit soubor

@ -1,23 +0,0 @@
{
"name": "btoa",
"homepage": "https://github.com/coolaj86/node-browser-compat",
"description": "btoa for Node.JS (it's a one-liner)",
"repository": {
"type": "git",
"url": "git://github.com/coolaj86/node-browser-compat.git"
},
"keywords": [
"btoa",
"browser"
],
"author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.info)",
"engines": {
"node": ">= 0.4.0"
},
"bin": {
"btoa": "bin/btoa.js"
},
"main": "index",
"license": "Apache2",
"version": "1.1.1"
}

Zobrazit soubor

@ -1,16 +0,0 @@
/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true eqeqeq:true immed:true latedef:true*/
(function () {
"use strict";
var btoa = require('./index')
, encoded = "SGVsbG8sIBZM"
, unencoded = "Hello, 世界"
;
if (encoded !== btoa(unencoded)) {
console.error('[FAIL]', encoded, btoa(unencoded));
return;
}
console.log('[PASS] all tests pass');
}());