-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AJ ONeal
committed
Sep 19, 2012
1 parent
ba6a628
commit c1673f2
Showing
6 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
atob | ||
=== | ||
|
||
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" | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,6 @@ | |
"bin": { | ||
"atob": "bin/atob.js" | ||
}, | ||
"version": "1.0.1" | ||
"license": "Apache2", | ||
"version": "1.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
btoa | ||
=== | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,6 @@ | |
"btoa": "bin/btoa.js" | ||
}, | ||
"main": "index", | ||
"version": "1.0.1" | ||
"license": "Apache2", | ||
"version": "1.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters