From e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Mon, 16 Nov 2020 00:10:28 +0100 Subject: api, login, auth --- node_modules/buffer-xor/.npmignore | 1 + node_modules/buffer-xor/.travis.yml | 9 +++++ node_modules/buffer-xor/LICENSE | 21 ++++++++++ node_modules/buffer-xor/README.md | 41 +++++++++++++++++++ node_modules/buffer-xor/index.js | 10 +++++ node_modules/buffer-xor/inline.js | 1 + node_modules/buffer-xor/inplace.js | 9 +++++ node_modules/buffer-xor/package.json | 64 ++++++++++++++++++++++++++++++ node_modules/buffer-xor/test/fixtures.json | 23 +++++++++++ node_modules/buffer-xor/test/index.js | 38 ++++++++++++++++++ 10 files changed, 217 insertions(+) create mode 100644 node_modules/buffer-xor/.npmignore create mode 100644 node_modules/buffer-xor/.travis.yml create mode 100644 node_modules/buffer-xor/LICENSE create mode 100644 node_modules/buffer-xor/README.md create mode 100644 node_modules/buffer-xor/index.js create mode 100644 node_modules/buffer-xor/inline.js create mode 100644 node_modules/buffer-xor/inplace.js create mode 100644 node_modules/buffer-xor/package.json create mode 100644 node_modules/buffer-xor/test/fixtures.json create mode 100644 node_modules/buffer-xor/test/index.js (limited to 'node_modules/buffer-xor') diff --git a/node_modules/buffer-xor/.npmignore b/node_modules/buffer-xor/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/buffer-xor/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/buffer-xor/.travis.yml b/node_modules/buffer-xor/.travis.yml new file mode 100644 index 0000000..d9f695b --- /dev/null +++ b/node_modules/buffer-xor/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +before_install: + - "npm install npm -g" +node_js: + - "0.12" +env: + - TEST_SUITE=standard + - TEST_SUITE=unit +script: "npm run-script $TEST_SUITE" diff --git a/node_modules/buffer-xor/LICENSE b/node_modules/buffer-xor/LICENSE new file mode 100644 index 0000000..bba5218 --- /dev/null +++ b/node_modules/buffer-xor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Daniel Cousens + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/buffer-xor/README.md b/node_modules/buffer-xor/README.md new file mode 100644 index 0000000..007f058 --- /dev/null +++ b/node_modules/buffer-xor/README.md @@ -0,0 +1,41 @@ +# buffer-xor + +[![TRAVIS](https://secure.travis-ci.org/crypto-browserify/buffer-xor.png)](http://travis-ci.org/crypto-browserify/buffer-xor) +[![NPM](http://img.shields.io/npm/v/buffer-xor.svg)](https://www.npmjs.org/package/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)) +// => +``` + + +Or for those seeking those few extra cycles, perform the operation in place: + +``` javascript +var xorInplace = require("buffer-xor/inplace") +var a = new Buffer('00ff0f', 'hex') +var b = new Buffer('f0f0', 'hex') + +console.log(xorInplace(a, b)) +// => +// NOTE: xorInplace will return the shorter slice of its parameters + +// See that a has been mutated +console.log(a) +// => +``` + + +## License [MIT](LICENSE) + diff --git a/node_modules/buffer-xor/index.js b/node_modules/buffer-xor/index.js new file mode 100644 index 0000000..85ee6f6 --- /dev/null +++ b/node_modules/buffer-xor/index.js @@ -0,0 +1,10 @@ +module.exports = function xor (a, b) { + var length = Math.min(a.length, b.length) + var buffer = new Buffer(length) + + for (var i = 0; i < length; ++i) { + buffer[i] = a[i] ^ b[i] + } + + return buffer +} diff --git a/node_modules/buffer-xor/inline.js b/node_modules/buffer-xor/inline.js new file mode 100644 index 0000000..8797570 --- /dev/null +++ b/node_modules/buffer-xor/inline.js @@ -0,0 +1 @@ +module.exports = require('./inplace') diff --git a/node_modules/buffer-xor/inplace.js b/node_modules/buffer-xor/inplace.js new file mode 100644 index 0000000..d71c172 --- /dev/null +++ b/node_modules/buffer-xor/inplace.js @@ -0,0 +1,9 @@ +module.exports = function xorInplace (a, b) { + var length = Math.min(a.length, b.length) + + for (var i = 0; i < length; ++i) { + a[i] = a[i] ^ b[i] + } + + return a.slice(0, length) +} diff --git a/node_modules/buffer-xor/package.json b/node_modules/buffer-xor/package.json new file mode 100644 index 0000000..9db3684 --- /dev/null +++ b/node_modules/buffer-xor/package.json @@ -0,0 +1,64 @@ +{ + "_from": "buffer-xor@^1.0.3", + "_id": "buffer-xor@1.0.3", + "_inBundle": false, + "_integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "_location": "/buffer-xor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "buffer-xor@^1.0.3", + "name": "buffer-xor", + "escapedName": "buffer-xor", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/browserify-aes" + ], + "_resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "_shasum": "26e61ed1422fb70dd42e6e36729ed51d855fe8d9", + "_spec": "buffer-xor@^1.0.3", + "_where": "/home/pruss/Dev/3-minute-website/node_modules/browserify-aes", + "author": { + "name": "Daniel Cousens" + }, + "bugs": { + "url": "https://github.com/crypto-browserify/buffer-xor/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A simple module for bitwise-xor on buffers", + "devDependencies": { + "mocha": "*", + "standard": "*" + }, + "homepage": "https://github.com/crypto-browserify/buffer-xor", + "keywords": [ + "bits", + "bitwise", + "buffer", + "buffer-xor", + "crypto", + "inline", + "math", + "memory", + "performance", + "xor" + ], + "license": "MIT", + "main": "index.js", + "name": "buffer-xor", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/buffer-xor.git" + }, + "scripts": { + "standard": "standard", + "test": "npm run-script unit", + "unit": "mocha" + }, + "version": "1.0.3" +} diff --git a/node_modules/buffer-xor/test/fixtures.json b/node_modules/buffer-xor/test/fixtures.json new file mode 100644 index 0000000..6f3431e --- /dev/null +++ b/node_modules/buffer-xor/test/fixtures.json @@ -0,0 +1,23 @@ +[ + { + "a": "000f", + "b": "f0ff", + "expected": "f0f0" + }, + { + "a": "000f0f", + "b": "f0ff", + "mutated": "f0f00f", + "expected": "f0f0" + }, + { + "a": "000f", + "b": "f0ffff", + "expected": "f0f0" + }, + { + "a": "000000", + "b": "000000", + "expected": "000000" + } +] diff --git a/node_modules/buffer-xor/test/index.js b/node_modules/buffer-xor/test/index.js new file mode 100644 index 0000000..06eacab --- /dev/null +++ b/node_modules/buffer-xor/test/index.js @@ -0,0 +1,38 @@ +/* global describe, it */ + +var assert = require('assert') +var xor = require('../') +var xorInplace = require('../inplace') +var fixtures = require('./fixtures') + +describe('xor', function () { + fixtures.forEach(function (f) { + it('returns ' + f.expected + ' for ' + f.a + '/' + f.b, function () { + var a = new Buffer(f.a, 'hex') + var b = new Buffer(f.b, 'hex') + var actual = xor(a, b) + + assert.equal(actual.toString('hex'), f.expected) + + // a/b unchanged + assert.equal(a.toString('hex'), f.a) + assert.equal(b.toString('hex'), f.b) + }) + }) +}) + +describe('xor/inplace', function () { + fixtures.forEach(function (f) { + it('returns ' + f.expected + ' for ' + f.a + '/' + f.b, function () { + var a = new Buffer(f.a, 'hex') + var b = new Buffer(f.b, 'hex') + var actual = xorInplace(a, b) + + assert.equal(actual.toString('hex'), f.expected) + + // a mutated, b unchanged + assert.equal(a.toString('hex'), f.mutated || f.expected) + assert.equal(b.toString('hex'), f.b) + }) + }) +}) -- cgit v1.2.3