Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buffer-noise

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer-noise

[![npm](https://img.shields.io/npm/v/buffer-noise.svg)](https://npmjs.com/package/buffer-noise) [![GitHub Actions Status](https://img.shields.io/github/workflow/status/ExodusMovement/buffer-noise/CI/master)](https://github.com/ExodusMovement/buffer-noise/

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

buffer-noise

npm GitHub Actions Status

Expand a buffer to a specified length. If the buffer is smaller than the specified length, the remaining space is filled with random bytes. A 32-bit Unsigned Big-Endian Integer containing the length of the data is always prepended to the buffer.

This module can be used for obfuscating an encrypted file's size for plausible deniability.

Installation

npm install buffer-noise

Usage

const size = 25
const { expand, shrink } = require('buffer-noise')(size)

const data = Buffer.from('Hello World!')
const newData = expand(data)
console.log(data, newData)
// Prints:
// <Buffer 48 65 6c 6c 6f 20 57 6f 72 6c 64 21>
// <Buffer 00 00 00 0c 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 91 5c d3 2f>
assert(newData.length === size)
assert(shrink(newData).equals(data))

License

MIT

FAQs

Package last updated on 15 Nov 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc