Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
base64
Advanced tools
Readme
Update: this module may no longer be necessary as nodejs includes its own base64 encoding/decoding functions.
This is a node.js C++ module that encodes and decodes to/from base64. Oh, and compared to all other modules, it actually works.
It was written by Peteris Krumins (peter@catonmat.net). His blog is at http://www.catonmat.net -- good coders code, great reuse.
To build the module run:
node-waf configure build
This will produce base64.node
binary module. To use it, make sure the
module's directory is in NODE_PATH.
The module exports two functions encode
and decode
.
Encodes a buffer to base64, returns encoded ascii string. Unlike all other base64, it actually works well with binary data. If you're wondering why it takes a buffer as argument, it's because there is no way to pass binary strings to C++ code in a sane way.
Here is a basic example:
var sys = require('sys');
var base64_encode = require('base64').encode;
var Buffer = require('buffer').Buffer;
var buf = new Buffer('hello world');
sys.print(base64_encode(buf));
/* Output: aGVsbG8gd29ybGQ= */
Decodes a buffer containing base64 string, or just a base64 string to original data.
var sys = require('sys');
var base64_decode = require('base64').decode;
sys.print(base64_decode('aGVsbG8gd29ybGQ='));
/* Output: hello world */
SGF2ZSBmdW4hCg==
Sincerely, Peteris Krumins http://www.catonmat.net
FAQs
A C++ module for node-js that does base64 encoding and decoding.
The npm package base64 receives a total of 438 weekly downloads. As such, base64 popularity was classified as not popular.
We found that base64 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.