mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 23:36:16 -04:00
correct translation from node Buffer to byte array
This commit is contained in:
parent
b98cab7d62
commit
638093d40e
3 changed files with 7 additions and 5 deletions
|
@ -22,9 +22,9 @@ class NodeDish extends Dish {
|
|||
|
||||
// Allow `fs` file input:
|
||||
// Any node fs Buffers transformed to array buffer
|
||||
// NOT Buffer.buff, as this makes a buffer of the whole object.
|
||||
// Use Array.from as Uint8Array doesnt pass instanceof Array test
|
||||
if (Buffer.isBuffer(inputOrDish)) {
|
||||
inputOrDish = new Uint8Array(inputOrDish).buffer;
|
||||
inputOrDish = Array.from(inputOrDish);
|
||||
type = Dish.BYTE_ARRAY;
|
||||
}
|
||||
super(inputOrDish, type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue