<commit_before>"use strict";

hex.Transform = require('./hex_transform');
hex.ChunkedTransform = require('./chunked_hex_transform');

module.exports = hex;

function hex(buffer, options) {
    options = options || {};
    if (!options.offsetWidth) {
        options.offsetWidth = 2 * Math.ceil(buffer.length.toString(16).length / 2);
    }
    var stream = hex.Transform(options);
    stream.write(buffer);
    stream.end();
    var out = String(stream.read());
    return out;
}<commit_msg>Strip trailing newline(s) from primary output<commit_after>"use strict";

hex.Transform = require('./hex_transform');
hex.ChunkedTransform = require('./chunked_hex_transform');

module.exports = hex;

function hex(buffer, options) {
    options = options || {};
    if (!options.offsetWidth) {
        options.offsetWidth = 2 * Math.ceil(buffer.length.toString(16).length / 2);
    }
    var stream = hex.Transform(options);
    stream.write(buffer);
    stream.end();
    var out = String(stream.read());
    out = out.replace(/\n+$/, '');
    return out;
}
{'fraction_non_alphanumeric': 0.16301239275500476, 'fraction_numerical': 0.0076263107721639654, 'mean_word_length': 3.646017699115044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4948122', 'n_tokens_mistral': 321, 'n_tokens_neox': 313, 'n_words': 65}