Dev.to Security πŸ” Cybersecurity πŸ‘ 1

How to Generate Secure Passwords with One API Call

The One-Liner curl "https://api.gadgethumans.com/password?length=32&symbols=true" JavaScript async function genPassword(length = 16) { const url = `https://api.gadgethumans.com/password?length=

The One-Liner

curl "https://api.gadgethumans.com/password?length=32&symbols=true"

JavaScript

async function genPassword(length = 16) {
  const url = `https://api.gadgethumans.com/password?length=${length}&symbols=true`;
  const resp = await fetch(url);
  return (await resp.json()).password;
}

Python

import requests
def gen_password(length=16, symbols=True):
    resp = requests.get('https://api.gadgethumans.com/password',
                        params={'length': length, 'symbols': symbols})
    return resp.json()['password']
print(gen_password(32))

Free - 100/day, no API key needed. api.gadgethumans.com

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.