Removed padLeft and padRight in favour of String.prototype.padStart and padEnd. 'To Hex' now supports ArrayBuffers.

This commit is contained in:
n1474335 2017-12-28 14:38:57 +00:00
parent e18ec5f2b2
commit 849d41ee56
15 changed files with 77 additions and 104 deletions

View file

@ -134,11 +134,11 @@ const BCD = {
switch (outputFormat) {
case "Nibbles":
return nibbles.map(n => {
return Utils.padLeft(n.toString(2), 4);
return n.toString(2).padStart(4, "0");
}).join(" ");
case "Bytes":
return bytes.map(b => {
return Utils.padLeft(b.toString(2), 8);
return b.toString(2).padStart(8, "0");
}).join(" ");
case "Raw":
default: