<commit_before>//
//  String.swift
//  Toolbelt
//
//  Created by <NAME> on 08/12/2015.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation

extension NSData {
    
    public var hexadecimalString : String {
        var str = String()
        var bytes = [UInt8](count: self.length, repeatedValue: 0)
        self.getBytes(&bytes, length: self.length)
        for byte in bytes {
            str += String(format: "%02x",byte)
        }
        return str
    }
    
}<commit_msg>Use `reduce` for hex string implementation<commit_after>//
//  String.swift
//  Toolbelt
//
//  Created by <NAME> on 08/12/2015.
//  Copyright © 2015 <NAME>. All rights reserved.
//

import Foundation

extension NSData {
    
    public var hexadecimalString : String {
        var bytes = [UInt8](count: self.length, repeatedValue: 0)
        self.getBytes(&bytes, length: self.length)
        return bytes.reduce(""){ return $0 + String(format:"%02x",$1)}
    }
    
}
{'fraction_non_alphanumeric': 0.1349124613800206, 'fraction_numerical': 0.035015447991761074, 'mean_word_length': 2.31740614334471, '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': '787873', 'n_tokens_mistral': 331, 'n_tokens_neox': 300, 'n_words': 86}