mirror of
https://github.com/pezkuwichain/pezkuwi-vanitygen.git
synced 2026-10-24 12:45:10 +00:00
- Replace all @polkadot/* dependencies with @pezkuwi/* - Update package.json metadata for Pezkuwichain - Update CLI command from polkadot-js-vanitygen to pezkuwi-vanitygen - Update network options: bizinikiwi, pezkuwi, dicle, zagros - Set default network to pezkuwi (ss58Format: 42) - Update documentation and README - Build and test successful - Version 1.0.0
31 lines
649 B
TypeScript
31 lines
649 B
TypeScript
// Copyright 2017-2025 @pezkuwi/vanitygen authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { GeneratorMatch } from './types.js';
|
|
|
|
function numberSort (a: number, b: number): number {
|
|
if (a > b) {
|
|
return -1;
|
|
} else if (a < b) {
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
export default function sort (a: GeneratorMatch, b: GeneratorMatch): number {
|
|
const countResult = numberSort(a.count, b.count);
|
|
|
|
if (countResult !== 0) {
|
|
return countResult;
|
|
}
|
|
|
|
const positionResult = numberSort(b.offset, a.offset);
|
|
|
|
if (positionResult !== 0) {
|
|
return positionResult;
|
|
}
|
|
|
|
return a.address.localeCompare(b.address);
|
|
}
|