mirror of
https://github.com/pezkuwichain/pezkuwi-vanitygen.git
synced 2026-11-09 20:27:08 +00:00
Initial commit: Fork @polkadot/vanitygen to @pezkuwi/vanitygen
- 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
This commit is contained in:
commit
6a860cecfe
29 files changed
+1312
No files matched your search
+30
@@ -0,0 +1,30 @@
|
||||
// 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);
|
||||
}
|
||||
Reference in new issue
Block a user