Skip to content

Commit

Permalink
0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ovx committed Jul 19, 2024
1 parent d5ac63a commit 42bf72f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 25 deletions.
7 changes: 1 addition & 6 deletions cjs/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,7 @@ function solveChallenge(challenge, salt, algorithm = 'SHA-256', max = 1e6, start
exports.solveChallenge = solveChallenge;
async function solveChallengeWorkers(workerScript, concurrency, challenge, salt, algorithm = 'SHA-256', max = 1e6, startNumber = 0) {
const workers = [];
if (concurrency < 1) {
throw new Error('Wrong number of workers configured.');
}
if (concurrency > 16) {
throw new Error('Too many workers. Max. 16 allowed workers.');
}
concurrency = Math.min(1, Math.max(16, concurrency));
for (let i = 0; i < concurrency; i++) {
if (typeof workerScript === 'function') {
workers.push(workerScript());
Expand Down
7 changes: 1 addition & 6 deletions deno_dist/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,7 @@ export async function solveChallengeWorkers(
startNumber: number = 0
) {
const workers: Worker[] = [];
if (concurrency < 1) {
throw new Error('Wrong number of workers configured.');
}
if (concurrency > 16) {
throw new Error('Too many workers. Max. 16 allowed workers.');
}
concurrency = Math.min(1, Math.max(16, concurrency));
for (let i = 0; i < concurrency; i++) {
if (typeof workerScript === 'function') {
workers.push(workerScript());
Expand Down
7 changes: 1 addition & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,7 @@ export function solveChallenge(challenge, salt, algorithm = 'SHA-256', max = 1e6
}
export async function solveChallengeWorkers(workerScript, concurrency, challenge, salt, algorithm = 'SHA-256', max = 1e6, startNumber = 0) {
const workers = [];
if (concurrency < 1) {
throw new Error('Wrong number of workers configured.');
}
if (concurrency > 16) {
throw new Error('Too many workers. Max. 16 allowed workers.');
}
concurrency = Math.min(1, Math.max(16, concurrency));
for (let i = 0; i < concurrency; i++) {
if (typeof workerScript === 'function') {
workers.push(workerScript());
Expand Down
7 changes: 1 addition & 6 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,7 @@ export async function solveChallengeWorkers(
startNumber: number = 0
) {
const workers: Worker[] = [];
if (concurrency < 1) {
throw new Error('Wrong number of workers configured.');
}
if (concurrency > 16) {
throw new Error('Too many workers. Max. 16 allowed workers.');
}
concurrency = Math.min(1, Math.max(16, concurrency));
for (let i = 0; i < concurrency; i++) {
if (typeof workerScript === 'function') {
workers.push(workerScript());
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "altcha-lib",
"version": "0.4.0",
"version": "0.4.1",
"description": "A library for creating and verifying ALTCHA challenges for Node.js, Bun and Deno.",
"author": "Daniel Regeci",
"license": "MIT",
Expand Down

0 comments on commit 42bf72f

Please sign in to comment.