Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
nomachine
on 20/04/2025, 06:21:27 UTC
How do you generate the first two characters randomly? I mean on Kw, Ky, Kz, L1, L5 etc... Tongue

Code:
void generate_valid_prefix(char* output, Xoshiro256plus& rng) {

    char first_char = 'K' + (rng.next() % 2);
    char second_char = (first_char == 'K') ? BASE58[57 - (rng.next() % 10)] : BASE58[rng.next() % 5];
    output[0] = first_char;
    output[1] = second_char;
    output[2] = '\0';
}

 Wink