{"id":15497495,"url":"https://github.com/bcomnes/xor-stream","last_synced_at":"2025-10-24T08:46:31.701Z","repository":{"id":48119764,"uuid":"52763511","full_name":"bcomnes/xor-stream","owner":"bcomnes","description":"Take two readable streams and return a readable stream with the xor of the two input chunks","archived":false,"fork":false,"pushed_at":"2020-05-31T17:02:17.000Z","size":285,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-23T10:42:48.262Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/xor-stream","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcomnes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-29T04:15:35.000Z","updated_at":"2019-08-21T08:44:54.000Z","dependencies_parsed_at":"2022-08-12T19:00:55.077Z","dependency_job_id":null,"html_url":"https://github.com/bcomnes/xor-stream","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bcomnes/xor-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fxor-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fxor-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fxor-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fxor-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcomnes","download_url":"https://codeload.github.com/bcomnes/xor-stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fxor-stream/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260022821,"owners_count":22947232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T08:38:47.873Z","updated_at":"2025-10-24T08:46:26.655Z","avatar_url":"https://github.com/bcomnes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xor-stream\n\nTake two readable streams and return a readable stream that contains chunkA XOR chunkB\n\n```\nnpm install xor-stream\n```\n\n[![Build Status](https://travis-ci.org/bcomnes/xor-stream.svg?branch=master)](https://travis-ci.org/bcomnes/xor-stream)\n\nThis can be used to calculate pairty blobs of the contents of two streams.\n\n##  Example\n\n``` js\nvar xorStream = require('xor-stream')\nvar streamEqual = require('stream-equal')\nvar rs = require('fs').createReadStream\n\nvar pairity = xorStream(rs('pathA'), rs('pathB'))\nvar contentOfA = xorStream(pairity, rs('pathB'))\n\nstreamEqual(rs('pathA'), contentOfA, function (err, equal) {\n  console.log(equal) // true if file A is larger than File B\n})\n```\n\nRight now, if one file is longer than the other, `xor-stream` pads the shorter stream with 0 bytes, so recovering shorter files from the longer file XOR pairty will have extra byte padding at the end.\n\n## Background\n\n- https://nodejs.org/api/buffer.html#buffer_new_buffer_str_encoding\n- https://github.com/feross/safe-buffer\n- https://www.npmjs.com/package/through2\n- http://www.snapraid.it/compare\n- https://en.wikipedia.org/wiki/Parchive\n- ((chunkA) || 0byte) xor (chunkB || 0byte )\n- https://github.com/mafintosh/stream-iterate\n- https://github.com/mafintosh/sorted-union-stream\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Fxor-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcomnes%2Fxor-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Fxor-stream/lists"}