Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gallolabs/passwd-verifier

Password verifier
https://github.com/gallolabs/passwd-verifier

Last synced: 5 days ago
JSON representation

Password verifier

Awesome Lists containing this project

README

        



Password Verifier

Validates passwords with support of htpasswd format.

```javascript
import {verifyPasswd, detectHashType} from '@gallolabs/passwd-verifier'

await verifyPasswd('myPasswd', '$2y$05$L/jPI05ltEKrwIjQThJ4keBFKH/aRDpxY9CaaVWYIZcPu0FXdRO6i') // false
await verifyPasswd('iAmNotHacker27!', '$2y$05$L/jPI05ltEKrwIjQThJ4keBFKH/aRDpxY9CaaVWYIZcPu0FXdRO6i') // true

detectHashType('$2y$05$L/jPI05ltEKrwIjQThJ4keBFKH/aRDpxY9CaaVWYIZcPu0FXdRO6i') // BCRYPT
```

Supports various format (sha, bcrypt, md5, crypt, plain). Like htpasswd command line, in case of plain password looking like crypt one, crypt is used. You can use options to disable crypt and/or plain. You can use detectHashType to refuse some password hash types in your side.