Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • DeathsChaos9: Well damn, long time no see m8
      May 27, 2018, 10:37:06 PM
    • usman555: i remembered out of nowhere and came to check how mopar was going
      May 27, 2018, 08:34:39 PM
    • usman555: remember azaruth, deathz
      May 27, 2018, 08:34:24 PM
    • usman555: hey
      May 27, 2018, 08:33:56 PM
    • Vain_: buying gf
      May 27, 2018, 01:53:12 PM
    • charmie: WILKO MY MAIN MAIN!
      May 26, 2018, 08:26:59 PM
    • DeathsChaos9::|
      May 26, 2018, 01:27:54 AM
    • Saltyspade10: Okay I won't be back
      May 24, 2018, 07:12:40 AM
    • [email protected]: im buying an ad banner from graham the owner need to get in contact
      May 23, 2018, 08:57:06 PM
    • [email protected]: any mods on
      May 23, 2018, 08:56:49 PM
    • kepoly: 11 years ago, damn
      May 23, 2018, 01:38:39 PM
    • B50: Sever error what happen
      May 22, 2018, 08:23:40 PM
    • The Soul: 10 years later
      May 21, 2018, 05:23:10 PM
    • The Soul: wow people are still here?
      May 21, 2018, 05:19:27 PM
    • Wilkooo: and apologies to the OG forum guys on behalf of that fudgewit dr house that pretty much killed this entire domain
      May 21, 2018, 04:14:28 PM
    • Wilkooo: shoutout to all those that played back in the beginning, all new people that hang around now seem to be pretty braindead
      May 21, 2018, 04:13:54 PM
    • Wilkooo: born sep 2016 - died whenever pink eggs resigned
      May 21, 2018, 04:11:29 PM
    • Wilkooo: Rip moparscape rsps
      May 21, 2018, 04:11:10 PM
    • puta loca: or what section can i ask this
      May 21, 2018, 05:45:08 AM
    • puta loca: does someoen has platinum ps v2 files?
      May 21, 2018, 05:44:59 AM

    Author Topic: Insane Random Key Generator With notepad limited ++  (Read 418 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineSpecial Air Service

    • Member
    • ***
    • Posts: 103
    • Thanks: +0/-0
      • View Profile
    Insane Random Key Generator With notepad limited ++
    « on: September 11, 2014, 01:19:04 PM »
    Wassup ma peoplez. How was your day? Anyway, we shall proceed
    I have created a wonder peace. A peace of work that is so good facebook want to buy it from me
    (click to show/hide)

    Anyway this has been lurking about the internet for a few seconds.

    And i will give you all the code

    Code: [Select]
    import java.security.SecureRandom;
    import java.util.Scanner;
    /**
     * This class is insane. This may have been released before
     * but here it is creeping up on Y'all again.
     * I do hope you enjoy this as it was made for
     * educational purposes only and i do not intend to hurt
     * anyone with this simple class
     * @author Zack/Optimum/Special Air Service
     *
     */
    class RandomKeyGenerator {

    /**
    * A list of all the characters that can be put into
    * the key itself
    */
    final static char[] KEYS = {
    '1', '2', '3', '4', '5', '6', '7', '8', '9',
    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
    'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
    's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
    };

    /**
    * This will register how much times the
    * loopKeys method has been called
    */
    static int loops = 0;

    /**
    * The main method
    * Everything is put together here
    * @param args
    */
    @SuppressWarnings("resource")
    public static void main(String[] args){
    new NotepadLimited();
    Scanner s = new Scanner(System.in);
    System.out.println("Enter the amount of keys you want to generate: ");
    int times = Integer.parseInt(s.nextLine());
    System.out.println("Enter the amount of characters you want in each key: ");
    int characters = Integer.parseInt(s.nextLine());
    System.out.println("Enter the number of characters before you put a dash after: ");
    int dashes = Integer.parseInt(s.nextLine());
    loopKeys(times, characters, dashes);
    }

    /**
    * This will loop the constructKey method
    * @param times
    * The amount if times it will repeat
    * itself
    * @param characters
    * The number of characters that will be in your loop
    * @param dashAfter
    * The number of characters before you put a dash
    */
    static void loopKeys(int times, int characters, int dashAfter){
    while(loops != times){
    constructKey(characters, dashAfter);
    loops++;
    }
    }

    /**
    * This method will construct the key itself to a
    * set number of characters and dashes
    * @param character
    * - The amount of characters that will be in 1 key
    * @param dashAfter
    * - Put a dash after a certain amount of characters
    */
    static void constructKey(int character, int dashAfter){
    int counter = 0;
    int dashCounter = 0;
    for(int i = 0; i < character; i++){
    int rnd = secureRnd(KEYS.length);
    System.out.print(KEYS[rnd]);
    counter++;
    while(counter == dashAfter && dashCounter != ((character / dashAfter) - 1)){
    System.out.print('-');
    counter = 0;
    dashCounter++;
    }
    }
    System.out.print('\n');
    }

    /**
    * This will generate a random number
    * @param number
    * This will be the number to randomise
    * 0-number
    * @return
    * the random number
    */
    static int secureRnd(int number){
    return new SecureRandom().nextInt(number);
    }

    }

    Code: [Select]
    import javax.swing.JFrame;
    import javax.swing.JTextArea;

    public class NotepadLimited extends JFrame{

    private static final long serialVersionUID = 8009645715138191580L;

    JTextArea txtPad = new JTextArea();

    public NotepadLimited(){
    this.setSize(400, 300);
    this.setTitle("Notepad Limited++");
    this.getContentPane().add(txtPad);
    txtPad.setSize(200,300);
    this.setVisible(true);
    }

    }

    and here is a screenshot:
    « Last Edit: September 11, 2014, 01:31:40 PM by Special Air Service »
    RS2Ad banner

    OfflinePure_

    • Member
    • ****
    • *
    • Posts: 4,687
    • Thanks: +0/-0
      • View Profile
    Re: Insane Random Key Generator With notepad limited ++
    « Reply #1 on: September 11, 2014, 01:57:38 PM »
    Is this a troll? If not good job.
    i won the forum
    RS2Ad banner

    OfflineHcoJustin

    • Member
    • ****
    • Posts: 2,400
    • Thanks: +0/-0
      • View Profile
    Re: Insane Random Key Generator With notepad limited ++
    « Reply #2 on: September 11, 2014, 02:13:43 PM »
    Is this a troll? If not good job.
    Of course its a troll
    RS2Ad banner

    OfflineSpecial Air Service

    • Member
    • ***
    • Posts: 103
    • Thanks: +0/-0
      • View Profile
    Re: Insane Random Key Generator With notepad limited ++
    « Reply #3 on: September 11, 2014, 05:20:33 PM »
    Is this a troll? If not good job.

    The notepad is a troll lol the number generator is made because i was bored

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal