Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A quick python script to hit the API, for those that don't want to use the webform (rightly so):

https://gist.github.com/ShakataGaNai/cb786a2c64abc83d4dbe0db...



Or, for those that don't want to use Python (in case it isn't installed, or requires a non-core module, I dunno) but have access to a Linux box:

    # echo -n "password" | sha1sum
    5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8  -
Take the first 5 characters, in this case "5baa6" and use at the end of the API endpoint in your browser. E.g.

    https://api.pwnedpasswords.com/range/5baa6
Then take the all the rest of the hash after the first 5 characters, in this case "1e4c9b93f3f0682250b6cf8331b7ee68fd8" and ctrl-f search the results page for it.


For ease:

  # echo -n "password" | sha1sum | cut -b 1-5
    5baa6


Yeah, but you would need two commands then, because you need to search for bytes 6-40 in the resulting output. I made a one-liner farther down the comments.[1]

1: https://news.ycombinator.com/item?id=16434244




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: