{"size": 559, "ext": "js", "max_stars_repo_path": "task4.js", "max_stars_repo_name": "anakreon/ctu-kbe-lab2", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "task4.js", "max_issues_repo_name": "anakreon/ctu-kbe-lab2", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "task4.js", "max_forks_repo_name": "anakreon/ctu-kbe-lab2", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.2916666667, "max_line_length": 74, "alphanum_fraction": 0.6279069767}
import { txt2hex } from './task0.js';

export function pad (hexInput) {
    const lengthMod16 = getLengthMod16(hexInput);
    const hexPadNumber = (lengthMod16.toString(16) + '').padStart(2, '0');
    let result = hexInput;
    for (var i = 0; i < lengthMod16; ++i) {
        result += hexPadNumber;
    }
    return result;
}

const getHexLengthBytes = (hex) => hex.length / 2;

const getLengthMod16 = (hex) => {
    const length = getHexLengthBytes(hex);
    const mod = length % 16;
    return 16 - mod;
}

export const _test = {
    getHexLengthBytes,
};
