fix : delete space and add new line

This commit is contained in:
Jeremy Giudicelli 2025-04-17 13:27:45 +02:00
parent ad91099d5e
commit 26d8fa51b0
2 changed files with 5 additions and 5 deletions

View file

@ -6,7 +6,7 @@
import Operation from "../Operation.mjs"; import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs"; import OperationError from "../errors/OperationError.mjs";
import { blake3 } from 'hash-wasm'; import { blake3 } from "hash-wasm";
/** /**
* BLAKE3 operation * BLAKE3 operation
*/ */
@ -21,7 +21,7 @@ class BLAKE3 extends Operation {
this.name = "BLAKE3"; this.name = "BLAKE3";
this.module = "Hashing"; this.module = "Hashing";
this.description = "Hashes the input using BLAKE3 (UTF-8 encoded), with an optional key (also UTF-8), and outputs the result in hexadecimal format."; this.description = "Hashes the input using BLAKE3 (UTF-8 encoded), with an optional key (also UTF-8), and outputs the result in hexadecimal format.";
this.infoURL = "https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3"; this.infoURL = "https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3";
this.inputType = "string"; this.inputType = "string";
this.outputType = "string"; this.outputType = "string";
this.args = [ this.args = [
@ -32,7 +32,7 @@ class BLAKE3 extends Operation {
"name": "Key", "name": "Key",
"type": "string", "type": "string",
"value": "" "value": ""
}, }
]; ];
} }
@ -47,7 +47,7 @@ class BLAKE3 extends Operation {
// Check if the user want a key hash or not // Check if the user want a key hash or not
if (key === "") { if (key === "") {
return blake3(input, size*8); return blake3(input, size*8);
}if (key.length !== 32) { } if (key.length !== 32) {
throw new OperationError("The key must be exactly 32 bytes long"); throw new OperationError("The key must be exactly 32 bytes long");
} }
return blake3(input, size*8, key); return blake3(input, size*8, key);

View file

@ -52,4 +52,4 @@ TestRegister.addTests([
"args": [8, "ThiskeyisexactlythirtytwoByteslo"] } "args": [8, "ThiskeyisexactlythirtytwoByteslo"] }
] ]
} }
]); ]);