att / qujata

Next-Gen Crypto. Quantified.
MIT License
13 stars 3 forks source link

Test run parameters - Message size #102

Closed ohadkoren closed 5 months ago

ohadkoren commented 5 months ago

Description

Currently, the entire application is working without the message size parameter.

As a backend developer, we need to make sure the application is making her analyze process including the message size.

As a frontend developer, it needs to be presented on the following section:

Predefined list of options in the UI 0 bytes, 1 byte, 2 bytes, 100 bytes, 1KB, 100KB, 200KB, 1MB, 2MB, 10MB These values will be provided in bytes from the backend. The user should be able to add more options as needed. (In bytes) The dropdown should take the bytes that are given as input and show them in the correct unit. The number itself in the dropdown should not exceed 3 digits. (500 KB is ok, 1024KB is not OK. Should be 1 MB). Below is a JS library + usage snippet that can help with that.

const filesize = require('filesize');

function convertBytesToHumanReadable(bytesValue) {
    /**
     * Convert bytes to human-readable units with a maximum of 3 digits.
     */
    return filesize(bytesValue, {round: 3});
}

// Example usage:
const bytesValue1 = 500 * 1024; // 500 KB
const bytesValue2 = 1024 * 1024; // 1024 KB
console.log(convertBytesToHumanReadable(bytesValue1)); // Output: 500.000 KB
console.log(convertBytesToHumanReadable(bytesValue2)); // Output: 1.000 MB

Acceptance Criteria

We should consider the "message size" parameter throughout the entire application.

Tasks