mosquitto-passwd
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Build Status Coverage Status npm version

mosquitto-passwd

Create mosquitto_passwd entries using only Node.JS.

Usage

const mosquittoPasswd = require('mosquitto-passwd')
 
// Username, password, salt (optional, by default will generate 12 bytes salt)
mosquittoPasswd('123', '123', Buffer.from('fcQNw5IJfhWEEEM4', 'base64')).then(entry => {
    console.log(entry) // 123:$6$fcQNw5IJfhWEEEM4$0rxaqu90qMJ0FLRlxCWPZiDFfemkc2UOpCHjUEKZ32C6AcKe9x5QKEFPuZwrW9jqoOmdOfP/3FKvbY48AFpSlA==
})
 
// Or use with await
console.log(await mosquittoPasswd(
    '123', 
    '123', 
    Buffer.from('fcQNw5IJfhWEEEM4', 'base64')
)) // 123:$6$fcQNw5IJfhWEEEM4$0rxaqu90qMJ0FLRlxCWPZiDFfemkc2UOpCHjUEKZ32C6AcKe9x5QKEFPuZwrW9jqoOmdOfP/3FKvbY48AFpSlA==

Package Sidebar

Install

npm i mosquitto-passwd

Weekly Downloads

12

Version

1.0.3

License

MIT

Unpacked Size

5.25 kB

Total Files

7

Last publish

Collaborators

  • rozpuszczalny