{"id":9395,"date":"2021-01-06T17:58:52","date_gmt":"2021-01-06T22:58:52","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=9395"},"modified":"2021-01-06T17:58:52","modified_gmt":"2021-01-06T22:58:52","slug":"building-a-password-generator-in-3-minutes","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=9395","title":{"rendered":"Building A Password Generator in 3 Minutes"},"content":{"rendered":"<p>Today\u2014the whole week really\u2014has been consumed by yak shaving so this is a short offering. Salah Qadri has a nice <a href=\"https:\/\/www.youtube.com\/watch?v=XumaK0kAkPI&amp;feature=emb_logo\">3 minute video<\/a> (3 minutes, 48 secs actually) in which he builds a reasonably good password generator.<\/p>\n<p>The generator builds a password from upper\/lower case letters, numbers, and symbols. The type of character and which one it is used are chosen randomly at each step using the Python random.choice method. One can argue that Qadri should have used the <a href=\"https:\/\/docs.python.org\/3\/library\/secrets.html#module-secrets\">secrets.choice<\/a> method instead but for occasional one-off passwords random.choice is probably adequate.<\/p>\n<p>My only other nit is that I would have used a more functional approach rather than relying on globals but that\u2019s more a personal preference. If you want to generate random passwords, Qadri\u2019s video has some nice ideas. I like the way he handled choosing a type of character randomly. The <a href=\"https:\/\/repl.it\/@salahh\/Password-generator#main.py\">code<\/a> is easy to follow even if you aren\u2019t a Python coder.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today\u2014the whole week really\u2014has been consumed by yak shaving so this is a short offering. Salah Qadri has a nice 3 minute video (3 minutes, 48 secs actually) in which he builds a reasonably good password generator. The generator builds &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=9395\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[3,37],"class_list":["post-9395","post","type-post","status-publish","format-standard","hentry","category-general","tag-security","tag-tech"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9395"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9395\/revisions"}],"predecessor-version":[{"id":9396,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9395\/revisions\/9396"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}