You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
450 B
CoffeeScript
18 lines
450 B
CoffeeScript
9 years ago
|
#!/usr/bin/env coffee
|
||
|
|
||
|
scrypt = require "scrypt-for-humans"
|
||
|
Promise = require "bluebird"
|
||
|
read = Promise.promisify(require "read")
|
||
|
|
||
|
Promise.try ->
|
||
|
read(prompt: "Enter a password:", silent: true)
|
||
|
.spread (password, isDefault) ->
|
||
|
if password.trim().length == 0
|
||
|
console.log "You didn't enter a password!"
|
||
|
process.exit(1)
|
||
|
|
||
|
scrypt.hash(password)
|
||
|
.then (hash) ->
|
||
|
console.log "Hash:", hash
|
||
|
console.log "Set this hash in your config.json to use it."
|