Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using U code to generate random garbled names #165

Open
ugugughu opened this issue Feb 13, 2025 · 1 comment
Open

Using U code to generate random garbled names #165

ugugughu opened this issue Feb 13, 2025 · 1 comment

Comments

@ugugughu
Copy link

Use a two-dimensional array to store two U code ranges, random generates random numbers to select U code ranges, and loops to generate characters of a specified length to generate obfuscated names.

import java.util.Random;

public class Name_Factory {
private static final int[][] UNICODE_RANGES = {
    {0x0100, 0x017F}, // Latin Extended-A
    {0x0370, 0x03FF}, // Greek and Coptic
    {0x0400, 0x04FF}  // Cyrillic alphabet
};
    public static String generateGlitchName(int length) {
        Random random = new Random();
        StringBuilder glitchName = new StringBuilder();

        for (int i = 0; i < length; i++) {
            // Randomly select a Unicode range
            int[] range = UNICODE_RANGES[random.nextInt(UNICODE_RANGES.length)];
            int start = range[0];
            int end = range[1];

            // Generate a random character
            int codePoint = random.nextInt(end - start + 1) + start;
            glitchName.append(Character.toChars(codePoint));
        }

        return glitchName.toString();
    }   
}
Details

Image

demo.apk.zip

@REAndroid
Copy link
Owner

For what ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants