Skip to content

Commit

Permalink
refactor(finance): simplify litecoin address implementation (#2495)
Browse files Browse the repository at this point in the history
Co-authored-by: DivisionByZero <leyla.jaehnig@gmx.de>
  • Loading branch information
ST-DDT and xDivisionByZerox authored Oct 23, 2023
1 parent bd19703 commit e901641
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/modules/finance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,12 +719,12 @@ export class FinanceModule {
litecoinAddress(): string {
const addressLength = this.faker.number.int({ min: 26, max: 33 });

let address = this.faker.helpers.arrayElement(['L', 'M', '3']);

for (let i = 0; i < addressLength - 1; i++)
address += this.faker.helpers.arrayElement([
...'123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ',
]);
const address =
this.faker.string.fromCharacters('LM3') +
this.faker.string.fromCharacters(
'123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ',
addressLength - 1
);

return address;
}
Expand Down

0 comments on commit e901641

Please sign in to comment.