point to new repo
This commit is contained in:
parent
7294e5e787
commit
001cf59083
|
@ -1,19 +1,4 @@
|
||||||
atob
|
MOVED
|
||||||
===
|
====
|
||||||
|
|
||||||
Uses `Buffer` to emulate the exact functionality of the browser's atob.
|
Now at https://github.com/node-browser-compat/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"
|
|
||||||
}());
|
|
||||||
|
|
|
@ -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]));
|
|
||||||
}());
|
|
|
@ -1,9 +0,0 @@
|
||||||
(function () {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function atob(str) {
|
|
||||||
return new Buffer(str, 'base64').toString('binary');
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = atob;
|
|
||||||
}());
|
|
|
@ -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"
|
|
||||||
}
|
|
20
atob/test.js
20
atob/test.js
|
@ -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');
|
|
||||||
}());
|
|
|
@ -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).
|
Now at https://github.com/node-browser-compat/btoa
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
|
@ -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]));
|
|
||||||
}());
|
|
|
@ -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;
|
|
||||||
}());
|
|
|
@ -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"
|
|
||||||
}
|
|
16
btoa/test.js
16
btoa/test.js
|
@ -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');
|
|
||||||
}());
|
|
Loading…
Reference in New Issue