Generate random password of specified length

This script generates a random password of a specified length. It uses a combination of ASCII letters (both uppercase and lowercase), digits, and punctuation symbols to create a secure password. The user can specify the desired length of the password, and the script will output a string that meets these criteria.

Script windmill

by henri186 ยท 4/17/2024

Other submissions
  • Submitted by henri186 Python3
    Created 755 days ago
    1
    import string
    2
    import random
    3
    
    
    4
    
    
    5
    def main(length: int) -> str:
    6
        # Define the characters that can be used in the password
    7
        characters = string.ascii_letters + string.digits + string.punctuation
    8
    
    
    9
        # Generate a random password of the specified length
    10
        password = "".join(random.choice(characters) for i in range(length))
    11
    
    
    12
        return password
    13
    
    
  • Submitted by matt.michaelree926 Bun
    Created 566 days ago
    1
    // import * as wmill from 'https://deno.land/x/windmill/index.ts'
    2
    
    
    3
    export async function main(x: string) {
    4
        return x
    5
    }