mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 05:32:18 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
1
web/node_modules/buffer-xor/.npmignore
generated
vendored
Normal file
1
web/node_modules/buffer-xor/.npmignore
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
node_modules
|
9
web/node_modules/buffer-xor/.travis.yml
generated
vendored
Normal file
9
web/node_modules/buffer-xor/.travis.yml
generated
vendored
Normal file
|
@ -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"
|
21
web/node_modules/buffer-xor/LICENSE
generated
vendored
Normal file
21
web/node_modules/buffer-xor/LICENSE
generated
vendored
Normal file
|
@ -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.
|
41
web/node_modules/buffer-xor/README.md
generated
vendored
Normal file
41
web/node_modules/buffer-xor/README.md
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
# buffer-xor
|
||||
|
||||
[](http://travis-ci.org/crypto-browserify/buffer-xor)
|
||||
[](https://www.npmjs.org/package/buffer-xor)
|
||||
|
||||
[](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>
|
||||
```
|
||||
|
||||
|
||||
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))
|
||||
// => <Buffer f0 0f>
|
||||
// NOTE: xorInplace will return the shorter slice of its parameters
|
||||
|
||||
// See that a has been mutated
|
||||
console.log(a)
|
||||
// => <Buffer f0 0f 0f>
|
||||
```
|
||||
|
||||
|
||||
## License [MIT](LICENSE)
|
||||
|
10
web/node_modules/buffer-xor/index.js
generated
vendored
Normal file
10
web/node_modules/buffer-xor/index.js
generated
vendored
Normal file
|
@ -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
|
||||
}
|
1
web/node_modules/buffer-xor/inline.js
generated
vendored
Normal file
1
web/node_modules/buffer-xor/inline.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
module.exports = require('./inplace')
|
9
web/node_modules/buffer-xor/inplace.js
generated
vendored
Normal file
9
web/node_modules/buffer-xor/inplace.js
generated
vendored
Normal file
|
@ -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)
|
||||
}
|
37
web/node_modules/buffer-xor/package.json
generated
vendored
Normal file
37
web/node_modules/buffer-xor/package.json
generated
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "buffer-xor",
|
||||
"version": "1.0.3",
|
||||
"description": "A simple module for bitwise-xor on buffers",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"standard": "standard",
|
||||
"test": "npm run-script unit",
|
||||
"unit": "mocha"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/crypto-browserify/buffer-xor.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/crypto-browserify/buffer-xor/issues"
|
||||
},
|
||||
"homepage": "https://github.com/crypto-browserify/buffer-xor",
|
||||
"keywords": [
|
||||
"bits",
|
||||
"bitwise",
|
||||
"buffer",
|
||||
"buffer-xor",
|
||||
"crypto",
|
||||
"inline",
|
||||
"math",
|
||||
"memory",
|
||||
"performance",
|
||||
"xor"
|
||||
],
|
||||
"author": "Daniel Cousens",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"standard": "*"
|
||||
}
|
||||
}
|
23
web/node_modules/buffer-xor/test/fixtures.json
generated
vendored
Normal file
23
web/node_modules/buffer-xor/test/fixtures.json
generated
vendored
Normal file
|
@ -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"
|
||||
}
|
||||
]
|
38
web/node_modules/buffer-xor/test/index.js
generated
vendored
Normal file
38
web/node_modules/buffer-xor/test/index.js
generated
vendored
Normal file
|
@ -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)
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue