Skip to content

Commit

Permalink
One liner console output by default
Browse files Browse the repository at this point in the history
  • Loading branch information
JD Conley committed Oct 12, 2016
1 parent 6ba12bc commit 3f96fa7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,12 @@ export namespace Measurement {
plain: "this is a super cool password",
saltLength: 16,
statusCallback: t => {
console.log(`Hashing took ${t.computeTimeMs}ms.
Parallelism: ${t.options.parallelism}.
MemoryCost: ${t.options.memoryCost} (${Math.pow(2, t.options.memoryCost) / 1024}MB).
TimeCost: ${t.options.timeCost}.`);
const ms = `Hashing took ${t.computeTimeMs}ms.`;
const pc = `Parallelism: ${t.options.parallelism}.`;
const mc = `MemoryCost: ${t.options.memoryCost} (${Math.pow(2, t.options.memoryCost) / 1024}MB).`;
const tc = `TimeCost: ${t.options.timeCost}.`;

console.log(`${ms} ${pc} ${mc} ${tc}`);

return true;
}
Expand Down

0 comments on commit 3f96fa7

Please sign in to comment.