<commit_before>let is_gtin = function (str) {
    try {
        var digits = Uint8Array.from([...str].map(x => parseInt(x)))
            .reverse()
    }
    catch (e) {
        return false;
    }
    const m = digits
        .slice(1)
        .reduce(
            (acc, x, i) => acc + x + (i & 1 == 0 ? x << 1 : 0), 0
        ) % 10;
    return digits[0] == (m == 0 ? m : 10 - m);
}
<commit_msg>Update is_gtin.js<commit_after>let is_gtin = function (str) {
    try {
        var digits = Uint8Array.from([...str].map(x => parseInt(x)))
            .reverse()
    }
    catch (e) {
        return false;
    }
    const m = digits
        .slice(1)
        .reduce(
            (acc, x, i) => acc - x + (x << (((i + 1) & 1) + 1)), 0
        ) % 10;
    return digits[0] == (m == 0 ? m : 10 - m);
}

{'fraction_non_alphanumeric': 0.18898623279098872, 'fraction_numerical': 0.03128911138923655, 'mean_word_length': 1.4691358024691359, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '441489', 'n_tokens_mistral': 319, 'n_tokens_neox': 295, 'n_words': 78}