base64 (binary Buffer encoding and decoding)
Allows buffer=>buffer encoding and decoding
Usage:
var base64=require("base64");
Encoding passwd file and storing with a new file name:
var base64=require("base64");
var fs=require("fs");
var f1=new fs.File("/etc/passwd");
f1.open("r");
var content=f1.read();
f1.close();
var encoded=base64.encode(content);
var f2=new fs.File("/tmp/passwd_base64_encoded");
f2.open("w");
f2.write(encoded);
f2.close();
List of static functions
Name | Arguments | Returns | Description |
---|---|---|---|
encode | Buffer | Buffer | Does base64 encoding of Buffer object |
decode | Buffer | Buffer | Does base64 decoding of Buffer object |