# buffer-xor

> A simple module for bitwise-xor on buffers

Latest version **2.0.2** (published 2017-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install buffer-xor
pnpm add buffer-xor
yarn add buffer-xor
bun add buffer-xor
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2017-08-21 |
| First published | 2015-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/buffer-xor) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Daniel Cousens |
| Maintainers | dcousens |
| Keywords | bits, bitwise, buffer, buffer-xor, crypto, inline, math, memory, performance, xor |

## Links

- npm: https://www.npmjs.com/package/buffer-xor
- Repository: https://github.com/crypto-browserify/buffer-xor
- Issues: https://github.com/crypto-browserify/buffer-xor/issues
- npm.io page: https://npm.io/package/buffer-xor

## Dependencies (1)

- [safe-buffer](https://npm.io/package/safe-buffer.md) ^5.1.1

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2017-08-21
- 2.0.1 — 2016-03-13
- 2.0.0 — 2016-03-11
- 1.0.3 — 2015-09-25
- 1.0.2 — 2015-05-21
- 1.0.1 — 2015-05-21
- 1.0.0 — 2015-05-21

## README

# buffer-xor

[![NPM Package](https://img.shields.io/npm/v/buffer-xor.svg?style=flat-square)](https://www.npmjs.org/package/buffer-xor)
[![Build Status](https://img.shields.io/travis/crypto-browserify/buffer-xor.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/buffer-xor)

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

A simple module for bitwise-xor on buffers.


## Examples

``` javascript
var xor = require('buffer-xor')
var a = new Buffer('00ff0f', 'hex')
var b = new Buffer('f0f0', 'hex')

console.log(xor(a, b))
// => <Buffer f0 0f 0f>
```


Or for those seeking those few extra cycles, perform the operation in place with
`xorInplace`:

_NOTE: `xorInplace` won't xor past the bounds of the buffer it mutates so make
sure it is long enough!_

``` javascript
var xorInplace = require('buffer-xor/inplace')
var a = new Buffer('00ff0f', 'hex')
var b = new Buffer('f0f0', 'hex')

console.log(xorInplace(a, b))
// => <Buffer f0 0f 0f>

// See that a has been mutated
console.log(a)
// => <Buffer f0 0f 0f>
```


## License [MIT](LICENSE)

---
_Source: https://npm.io/package/buffer-xor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
