Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Jun 2, 2024 via pnpm
Package summary
Share
0
issues
1
license
1
MIT
Package created
13 Jan 2016
Version published
25 Apr 2018
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
safe-buffer@5.1.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of safe-buffer 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does safe-buffer do?

Safe-buffer is a safer Node.js Buffer API. It employs the new Node.js Buffer APIs, including Buffer.from, Buffer.alloc, Buffer.allocUnsafe, and Buffer.allocUnsafeSlow, in all versions of Node.js. The package's main function is to provide a safe replacement for the node.js Buffer. It uses the built-in implementation when available. This lends to the mitigation of certain security issues related to uninitialized memory disclosure associated with the Buffer constructor in Node.js.

How do you use safe-buffer?

You can use safe-buffer as a drop-in replacement for the default Buffer in Node.js. This can be done by simply requiring 'safe-buffer'. All current code should continue functioning without issues. Here's a brief code usage example:

var Buffer = require('safe-buffer').Buffer;

// Existing buffer code will continue to work without issues:

new Buffer('hey', 'utf8');
new Buffer([1, 2, 3], 'utf8');
new Buffer(obj);
new Buffer(16); // create an uninitialized buffer (potentially unsafe)

// But you can use these new explicit APIs to make clear what you want:

Buffer.from('hey', 'utf8'); // convert from many types to a Buffer
Buffer.alloc(16); // create a zero-filled buffer (safe)
Buffer.allocUnsafe(16); // create an uninitialized buffer (potentially unsafe)

This package should be installed using npm install safe-buffer.

Where are the safe-buffer docs?

For comprehensive information on safe-buffer, it's recommended to refer to the official Node.js Buffer API documentation which can be found at this link. Additionally, the original package repository on GitHub contains further usage examples and information, and can be accessed at git://github.com/feross/safe-buffer.git.