<commit_before>//
//  String+Additions.swift
//  iOSCategories
//
//  Created by <NAME> on 6/1/15.
//  Copyright (c) 2015 Applico Inc. All rights reserved.
//

import Foundation

extension String {
    
    func randomStringOfLength(length: Int) -> String {
        let characterSet = Array("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
        var randomString = String()
        randomString.reserveCapacity(length)
        
        for index in 0...length - 1 {
            randomString.append(characterSet[Int(arc4random_uniform(UInt32(characterSet.count)))])
        }
        
        return randomString
    }
    
    init (randomStringOfLength: Int) {
        let str = randomStringOfLength(randomStringOfLength)
        super.init()
        return str
    }
    
    func GUIDString() -> String {
        
        var guid: String
        
        let newUniqueID = CFUUIDCreate(kCFAllocatorDefault)
        let newUniqueIDString = CFUUIDCreateString(kCFAllocatorDefault, newUniqueID)
        if let guid = newUniqueIDString as? String {
            return guid
        }
        
        return ""
    }
}<commit_msg>working on custom init<commit_after>//
//  String+Additions.swift
//  iOSCategories
//
//  Created by <NAME> on 6/1/15.
//  Copyright (c) 2015 Applico Inc. All rights reserved.
//

import Foundation

extension String {
    
    func randomStringOfLength(length: Int) -> String {
        let characterSet = Array("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
        var randomString = String()
        randomString.reserveCapacity(length)
        
        for index in 0...length - 1 {
            randomString.append(characterSet[Int(arc4random_uniform(UInt32(characterSet.count)))])
        }
        
        return randomString
    }
    
    //    init?(randomStringOfLength: Int) {
    //        if randomStringOfLength == 0 {
    //            return nil
    //        } else {
    //            super.init()
    //            self = randomStringOfLength(randomStringOfLength)
    //        }
    //    }
    
    func GUIDString() -> String {
        
        var guid: String
        
        let newUniqueID = CFUUIDCreate(kCFAllocatorDefault)
        let newUniqueIDString = CFUUIDCreateString(kCFAllocatorDefault, newUniqueID)
        if let guid = newUniqueIDString as? String {
            return guid
        }
        
        return ""
    }
}
{'fraction_non_alphanumeric': 0.08937397034596375, 'fraction_numerical': 0.019357495881383854, 'mean_word_length': 1.9730722154222766, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1852502', 'n_tokens_mistral': 744, 'n_tokens_neox': 696, 'n_words': 145}