Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Iterable ARC4
npm install arc4-lib
import { ARC4, ARC4_LENGTH, seedFromUnsafeBuffer } from 'arc4-lib';
let mixinArray: number[];
let seed: any = 'a any type seed';
//seed = '][简日双语MP4][720P]';
//seed = createArray(ARC4_LENGTH * 2, (v, i) => i * Math.random());
let arc4 = ARC4(seed, mixinArray, {
// mixinArray: true,
/**
* make iterator never end
*/
// loop: true,
/**
* show arc4 state and real seed
*/
state: true,
});
let i = 5;
for (let v of arc4)
{
i--;
console.log(1, v);
if (!i)
{
break;
}
}
i = 5;
while (i--)
{
console.log(i, arc4.next());
}
i = 260;
i = 5;
while (i--)
{
console.log(i, arc4rand());
}
console.log(JSON.stringify(arc4));
let t = Buffer.from('k12');
let t1 = arc4.transform(t);
/**
* when loop is true, will not transform t1 back to t
*/
let t2 = arc4.transform(t1);
console.log(t, t1, t2);
console.log(t1.toString('hex'), t2.toString('hex'));
/**
* fake random
*/
function arc4rand()
{
if (0)
{
let number =
arc4.next() * 0x1
+ arc4.next() * 0x100000000
+ arc4.next() * 0x1000000
+ arc4.next() * 0x10000
+ arc4.next() * 0x100
+ arc4.next() * 0x100000000000000
+ arc4.next() * 0x1000000000000
+ arc4.next() * 0x10000000000
;
let random = number / 0x10000000000000000;
return random
}
let number =
arc4.next() * 0x1
+ arc4.next() * 0x100
+ arc4.next() * 0x10000
+ arc4.next() * 0x1000000
+ arc4.next() * 0x100000000
+ arc4.next() * 0x10000000000
+ arc4.next() * 0x1000000000000
+ arc4.next() * 0x100000000000000
;
let random = number / 18446744073709551616;
return random
}
FAQs
Iterable ARC4
We found that arc4-lib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.