فهرست منبع

byte length argument added to ToBinary

n1073645 4 سال پیش
والد
کامیت
9dba1232b7
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      src/core/operations/ToBinary.mjs

+ 7 - 1
src/core/operations/ToBinary.mjs

@@ -31,6 +31,11 @@ class ToBinary extends Operation {
                 "name": "Delimiter",
                 "name": "Delimiter",
                 "type": "option",
                 "type": "option",
                 "value": BIN_DELIM_OPTIONS
                 "value": BIN_DELIM_OPTIONS
+            },
+            {
+                "name": "Byte Length",
+                "type": "number",
+                "value": 8
             }
             }
         ];
         ];
     }
     }
@@ -42,7 +47,8 @@ class ToBinary extends Operation {
      */
      */
     run(input, args) {
     run(input, args) {
         input = new Uint8Array(input);
         input = new Uint8Array(input);
-        return toBinary(input, args[0]);
+        const padding = args[1] ? args[1] : 8;
+        return toBinary(input, args[0], padding);
     }
     }
 
 
     /**
     /**