Skip to content

Commit

Permalink
fix(all): Create bot working again.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Jul 18, 2023
1 parent 53a055c commit c4f8d0a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/admin.gbapp/services/GBAdminService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,16 @@ export class GBAdminService implements IGBAdminService {
return lowercase_PW(14);
}

public static getNumberIdentifier(size: number = 14): string {
return Math.floor(Math.random() * size).toString();
public static getNumberIdentifier(digits: number = 14): string {

if (digits <= 0) {
throw new Error('Number of digits should be greater than 0.');
}

const min = 10 ** (digits - 1);
const max = 10 ** digits - 1;
const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNumber.toString();
}

/**
Expand Down

0 comments on commit c4f8d0a

Please sign in to comment.