Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef VANITY_CONFIG
#define VANITY_CONFIG

import * as fs from 'fs';

static int const MAX_ITERATIONS = 1000000000;
static int const STOP_AFTER_KEYS_FOUND = 100;

Expand All @@ -20,4 +22,20 @@ __device__ static char const *prefixes[] = {
// "_" to denote exact case
// "@" to denote case insensitive
__device__ static char const *prefix_ignore_case_mask = "@@@@@@@@";

async function handleResult(result: any, publicKey: string) {
// Create filename using the public key
const filename = `${publicKey}.json`;

try {
// Convert result to JSON string with pretty formatting
const jsonData = JSON.stringify(result, null, 2);

// Write to file asynchronously
await fs.promises.writeFile(filename, jsonData);
console.log(`Results saved to ${filename}`);
} catch (error) {
console.error('Error saving results:', error);
}
}
#endif