Initial commit
This commit is contained in:
16 files changed
+2890
No files matched your search
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// AppDelegate.h
|
||||
// Password Generator
|
||||
//
|
||||
// Created by User on 9/16/26.
|
||||
// Copyright (c) 2026 User. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
|
||||
@property (assign) IBOutlet NSWindow *window;
|
||||
@property (assign) IBOutlet NSTextField *lengthText;
|
||||
@property (assign) IBOutlet NSSlider *lengthSlider;
|
||||
@property (assign) IBOutlet NSTextField *outputBox;
|
||||
@property (assign) IBOutlet NSButton *uppercaseCheck;
|
||||
@property (assign) IBOutlet NSButton *lowercaseCheck;
|
||||
@property (assign) IBOutlet NSButton *numbersCheck;
|
||||
@property (assign) IBOutlet NSButton *symbolsCheck;
|
||||
@property (assign) IBOutlet NSButton *regenerateButton;
|
||||
|
||||
- (IBAction)lengthSliderChanged:(id)sender;
|
||||
|
||||
- (IBAction)preset8ButtonClicked:(id)sender;
|
||||
- (IBAction)preset16ButtonClicked:(id)sender;
|
||||
- (IBAction)preset32ButtonClicked:(id)sender;
|
||||
- (IBAction)preset64ButtonClicked:(id)sender;
|
||||
- (IBAction)preset128ButtonClicked:(id)sender;
|
||||
|
||||
- (IBAction)checkBoxChange:(id)sender;
|
||||
- (IBAction)copyButtonClicked:(id)sender;
|
||||
- (IBAction)regenerateButtonClicked:(id)sender;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,89 @@
|
||||
//
|
||||
// AppDelegate.m
|
||||
// Password Generator
|
||||
//
|
||||
// Created by User on 9/16/26.
|
||||
// Copyright (c) 2026 User. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
[self.regenerateButton sendAction:self.regenerateButton.action to:self.regenerateButton.target];
|
||||
}
|
||||
|
||||
- (IBAction)lengthSliderChanged:(id)sender {
|
||||
[self.lengthText setStringValue:[NSString stringWithFormat:@"Password Length: %ld", (long)[sender integerValue]]];
|
||||
[self.regenerateButton sendAction:self.regenerateButton.action to:self.regenerateButton.target];
|
||||
}
|
||||
|
||||
// preset buttons
|
||||
|
||||
- (IBAction)preset8ButtonClicked:(id)sender
|
||||
{
|
||||
self.lengthSlider.integerValue = 8;
|
||||
[self.lengthSlider sendAction:self.lengthSlider.action to:self.lengthSlider.target];
|
||||
}
|
||||
|
||||
- (IBAction)preset16ButtonClicked:(id)sender
|
||||
{
|
||||
self.lengthSlider.integerValue = 16;
|
||||
[self.lengthSlider sendAction:self.lengthSlider.action to:self.lengthSlider.target];
|
||||
}
|
||||
|
||||
- (IBAction)preset32ButtonClicked:(id)sender
|
||||
{
|
||||
self.lengthSlider.integerValue = 32;
|
||||
[self.lengthSlider sendAction:self.lengthSlider.action to:self.lengthSlider.target];
|
||||
}
|
||||
|
||||
- (IBAction)preset64ButtonClicked:(id)sender
|
||||
{
|
||||
self.lengthSlider.integerValue = 64;
|
||||
[self.lengthSlider sendAction:self.lengthSlider.action to:self.lengthSlider.target];
|
||||
}
|
||||
|
||||
- (IBAction)preset128ButtonClicked:(id)sender
|
||||
{
|
||||
self.lengthSlider.integerValue = 128;
|
||||
[self.lengthSlider sendAction:self.lengthSlider.action to:self.lengthSlider.target];
|
||||
}
|
||||
|
||||
// end
|
||||
|
||||
- (IBAction)checkBoxChange:(id)sender
|
||||
{
|
||||
[self.regenerateButton sendAction:self.regenerateButton.action to:self.regenerateButton.target];
|
||||
}
|
||||
|
||||
- (IBAction)regenerateButtonClicked:(id)sender {
|
||||
NSMutableString *chars = [NSMutableString string];
|
||||
if ([self.uppercaseCheck state] == NSOnState) [chars appendString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZ"];
|
||||
if ([self.lowercaseCheck state] == NSOnState) [chars appendString:@"abcdefghijklmnopqrstuvwxyz"];
|
||||
if ([self.numbersCheck state] == NSOnState) [chars appendString:@"0123456789"];
|
||||
if ([self.symbolsCheck state] == NSOnState) [chars appendString:@"!@#$%^&*"];
|
||||
|
||||
if (chars.length == 0) {
|
||||
[self.outputBox setStringValue:@""];
|
||||
return;
|
||||
}
|
||||
|
||||
NSMutableString *password = [NSMutableString stringWithCapacity:self.lengthSlider.integerValue];
|
||||
for (NSUInteger i = 0; i < self.lengthSlider.integerValue; i++) {
|
||||
uint32_t randomIndex = arc4random_uniform((uint32_t)chars.length);
|
||||
unichar c = [chars characterAtIndex:randomIndex];
|
||||
[password appendFormat:@"%C", c];
|
||||
}
|
||||
|
||||
[self.outputBox setStringValue:[password copy]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>xyz.lncvrt.xyz.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2026 User. All rights reserved.</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,7 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'Password Generator' target in the 'Password Generator' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
@@ -0,0 +1,29 @@
|
||||
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\paperw9840\paperh8400
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
|
||||
|
||||
\f0\b\fs24 \cf0 Engineering:
|
||||
\b0 \
|
||||
Some people\
|
||||
\
|
||||
|
||||
\b Human Interface Design:
|
||||
\b0 \
|
||||
Some other people\
|
||||
\
|
||||
|
||||
\b Testing:
|
||||
\b0 \
|
||||
Hopefully not nobody\
|
||||
\
|
||||
|
||||
\b Documentation:
|
||||
\b0 \
|
||||
Whoever\
|
||||
\
|
||||
|
||||
\b With special thanks to:
|
||||
\b0 \
|
||||
Mom\
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// main.m
|
||||
// Password Generator
|
||||
//
|
||||
// Created by User on 9/16/26.
|
||||
// Copyright (c) 2026 User. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
||||
Reference in new issue
Block a user