Documentation
    Preparing search index...
    • Generates a random mobile phone number with customizable prefix.

      Creates a mobile phone number in the format: [prefix][3-4 digits][4 digits]. The middle section is 3 digits if the random number is less than 1000, otherwise 4 digits. The last section is always 4 digits, zero-padded if necessary. Commonly used for generating Korean mobile phone numbers or similar formats.

      Parameters

      • prefix: string = "010"

        The prefix string for the phone number (default: "010")

      Returns string

      A formatted mobile phone number string

        RandomGenerator.mobile();        // e.g. "0103341234" or "01012345678"
      RandomGenerator.mobile("011"); // e.g. "0119876543" or "01112345678"
      RandomGenerator.mobile("+82"); // e.g. "+823341234" or "+8212345678"

      // Generate test user phone numbers
      const testUsers = Array.from({ length: 100 }, () => ({
      name: RandomGenerator.name(),
      phone: RandomGenerator.mobile(),
      altPhone: RandomGenerator.mobile("011")
      }));

      // Create international phone numbers
      const internationalPhone = RandomGenerator.mobile("+821");

      // Generate contact list for testing
      const contacts = ["010", "011", "016", "017", "018", "019"].map(prefix => ({
      carrier: prefix,
      number: RandomGenerator.mobile(prefix)
      }));