Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brasilikum/is-password-known
Package for elm that checks a password agians the public API of haveibeenpwned.com
https://github.com/brasilikum/is-password-known
elm elm-lang haveibeenpawned haveibeenpwned password-safety password-strength
Last synced: 26 days ago
JSON representation
Package for elm that checks a password agians the public API of haveibeenpwned.com
- Host: GitHub
- URL: https://github.com/brasilikum/is-password-known
- Owner: brasilikum
- License: mit
- Created: 2018-10-22T01:44:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-22T13:51:20.000Z (about 6 years ago)
- Last Synced: 2024-11-30T19:42:31.094Z (26 days ago)
- Topics: elm, elm-lang, haveibeenpawned, haveibeenpwned, password-safety, password-strength
- Language: Elm
- Size: 188 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Is this password known?
This elm package checks a given password against the API of haveibeenpwned.com.
## Usage
```elm
requestPassword: String -> Cmd Msg
requestPassword pass =
pass
|> hashAndCut
|> Debug.log "This will be sent to HaveIBeenPawned.com"
|> requestPossibleMatches
|> Http.send PasswordResponse
``````elm
update msg model =
case msg of
SetPassword pass ->
( { model | password = pass }, Cmd.none )CheckPassword ->
( model, requestPassword model.password )PasswordResponse (Ok resp) ->
( { model
| isPasswordKnown =
Just (isPasswordKnown model.password resp)
}
, Cmd.none
)
```