1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00

Improving the get restream credentials

This commit is contained in:
DanieL 2022-05-20 16:22:54 -03:00
parent 654dda115a
commit 56cb1fd5cb
6058 changed files with 1166166 additions and 1430809 deletions

View file

@ -1,32 +1,32 @@
var
QUnit = require('qunit'),
toUnsigned = require('../lib/utils/bin').toUnsigned;
QUnit.module('Binary Utils');
QUnit.test('converts values to unsigned integers after bitwise operations', function(assert) {
var bytes;
bytes = [0, 0, 124, 129];
assert.equal(toUnsigned(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3]),
31873, 'positive signed result stays positive');
bytes = [150, 234, 221, 192];
// sanity check
assert.equal(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3],
-1762992704, 'bitwise operation produces negative signed result');
assert.equal(toUnsigned(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3]),
2531974592, 'negative signed result becomes unsigned positive');
});
var
QUnit = require('qunit'),
toUnsigned = require('../lib/utils/bin').toUnsigned;
QUnit.module('Binary Utils');
QUnit.test('converts values to unsigned integers after bitwise operations', function(assert) {
var bytes;
bytes = [0, 0, 124, 129];
assert.equal(toUnsigned(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3]),
31873, 'positive signed result stays positive');
bytes = [150, 234, 221, 192];
// sanity check
assert.equal(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3],
-1762992704, 'bitwise operation produces negative signed result');
assert.equal(toUnsigned(bytes[0] << 24 |
bytes[1] << 16 |
bytes[2] << 8 |
bytes[3]),
2531974592, 'negative signed result becomes unsigned positive');
});