forked from pissmissle/piss-or-gay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate.js
More file actions
95 lines (83 loc) · 4.17 KB
/
generate.js
File metadata and controls
95 lines (83 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env node
/**
* piss-or-gay — solana vanity wallet generator
* PISSMISSLE INDUSTRIES® — powered by PissTek™
*
* generates wallets ending in "piss" or "gay". nothing else.
* 只有尿和同性恋. (╯°□°)╯
*/
const nacl = require('tweetnacl');
const bs58 = require('bs58');
const VALID_SUFFIXES = ['piss', 'gay'];
function generate(suffix) {
if (!VALID_SUFFIXES.includes(suffix.toLowerCase())) {
console.log('');
console.log(' ⚠️ INVALID SUFFIX. 无效后缀.');
console.log(' you get two options: piss or gay.');
console.log(' that\'s it. 就这样. no customization.');
console.log(' this is not a democracy. 这不是民主. (╬ಠ益ಠ)');
console.log('');
console.log(' usage: node generate.js piss');
console.log(' node generate.js gay');
console.log('');
process.exit(1);
}
const target = suffix.toLowerCase();
console.log('');
console.log(' ╔═══════════════════════════════════════╗');
console.log(' ║ piss-or-gay vanity wallet generator ║');
console.log(' ║ PISSMISSLE INDUSTRIES® — PissTek™ ║');
console.log(' ╚═══════════════════════════════════════╝');
console.log('');
console.log(` 🎯 searching for wallet ending in "${target}"...`);
console.log(` ⏳ ${target === 'piss' ? 'this might take a while. 4 chars is hard. get coffee. 去喝咖啡.' : 'this should be quick. 3 chars is easy mode. 简单模式.'}`);
console.log('');
const startTime = Date.now();
let attempts = 0;
while (true) {
attempts++;
const keypair = nacl.sign.keyPair();
const publicKey = bs58.encode(keypair.publicKey);
// Case-insensitive match — base58 is mixed case
if (publicKey.slice(-target.length).toLowerCase() === target) {
const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);
const secretKey = bs58.encode(keypair.secretKey);
console.log(' ═══════════════════════════════════════');
console.log(` 🎯 FOUND: ${target.toUpperCase()} WALLET`);
console.log(' ═══════════════════════════════════════');
console.log(` Address: ${publicKey}`);
console.log(` Private: ${secretKey}`);
console.log(` Attempts: ${attempts.toLocaleString()}`);
console.log(` Time: ${elapsed}s`);
console.log(' ═══════════════════════════════════════');
console.log(' SAVE YOUR PRIVATE KEY. 保存你的私钥.');
console.log(' I\'M NOT YOUR MOM. 我不是你妈.');
console.log(' DON\'T SHARE IT WITH ANYONE. 不要和任何人分享.');
console.log(' ESPECIALLY NOT FENT. 尤其不要和FENT分享.');
console.log(' HE\'LL POST IT IN A GROUP CHAT. 他会发到群聊里.');
console.log(' (╯°□°)╯');
console.log('');
return;
}
if (attempts % 10000 === 0) {
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
process.stdout.write(`\r ⛏️ ${attempts.toLocaleString()} attempts... ${elapsed}s elapsed`);
}
}
}
const suffix = process.argv[2];
if (!suffix) {
console.log('');
console.log(' piss-or-gay — solana vanity wallet generator');
console.log(' PISSMISSLE INDUSTRIES® — PissTek™');
console.log('');
console.log(' usage: node generate.js <piss|gay>');
console.log('');
console.log(' piss = 4 chars = hard mode = strong tek required');
console.log(' gay = 3 chars = easy mode = weak tek acceptable');
console.log('');
console.log(' no other options. 没有其他选项. (╬ಠ益ಠ)');
console.log('');
process.exit(1);
}
generate(suffix);