9 lines
271 B
JavaScript
9 lines
271 B
JavaScript
import { hashPassword } from '../password.mjs';
|
|
|
|
let input = '';
|
|
for await (const chunk of process.stdin) {
|
|
input += chunk;
|
|
if (input.length > 2048) throw new Error('Password input too long');
|
|
}
|
|
process.stdout.write(hashPassword(input.replace(/\r?\n$/, '')) + '\n');
|