Skip to content

Commit

Permalink
add compact level in wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm360 committed Jul 27, 2024
1 parent f18e05b commit 17f6eb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/BeeNet.Util.Wasm/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ public partial class BeeNetWasmUtil
internal static async Task<string> GetHashStringAsync(
byte[] data,
string fileContentType,
string fileName)
string fileName,
int compactLevel)
{
var calculatorService = new CalculatorService();
var result = await calculatorService.EvaluateFileUploadAsync(
data,
fileContentType,
fileName).ConfigureAwait(false);
fileName,
compactLevel: (ushort)compactLevel).ConfigureAwait(false);
return result.Hash.ToString();
}
}
3 changes: 2 additions & 1 deletion src/BeeNet.Util.Wasm/wwwroot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ let array = utf8Encode.encode("Bzz over the world!");
const hash = await exports.BeeNetWasmUtil.GetHashStringAsync(
array,
"text/plain",
"hello.txt"
"hello.txt",
10
);
console.log(hash);

Expand Down

0 comments on commit 17f6eb7

Please sign in to comment.