<commit_before>//
//  KeyStorage - Simplifying securely saving key information
//  KeyStorageCrypter.swift
//
//  Created by <NAME> on 3/23/16.
//  Copyright © 2016 bencoding.<EMAIL>. All rights reserved.
//


import Foundation

public protocol KeyStorageCrypter {
    func encrypt(data: Data, forKey: String) -> Data
    func decrypt(data: Data, forKey: String) -> Data
}
<commit_msg>Update documentation<commit_after>//
//  KeyStorage - Simplifying securely saving key information
//  KeyStorageCrypter.swift
//
//  Created by <NAME> on 3/23/16.
//  Copyright © 2016 b<EMAIL>.<EMAIL>. All rights reserved.
//


import Foundation

/**
 
 Protocol used to enforce the contract for encrypting and decrypting storage values.
 
 You can provide your own encrypt/decrypt functionality to any of the Storage Providers as long as it conforms to this protocol.
 
 */
public protocol KeyStorageCrypter {
    /**
     Returns an encrypted Data type.
     
     - Parameter forKey: The key for the data element that should be encrypted.
     - Parameter data: The Data that should be encrypted
     - Returns: The Data in encrypted form. This will be persisted by the Storage Provider.
     */
    func encrypt(data: Data, forKey: String) -> Data
    
    /**
     Returns an unencrypted Data type
     
     - Parameter forKey: The key for the data element that should be decrypted.
     - Parameter data: The Data that should be decrypted
     - Returns: The Data in decrypted form. This will be converted to one of the supported types and returned to the caller.
     */
    func decrypt(data: Data, forKey: String) -> Data
}

{'fraction_non_alphanumeric': 0.08091414453366276, 'fraction_numerical': 0.011117974058060531, 'mean_word_length': 2.9320388349514563, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, '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': '5205175', 'n_tokens_mistral': 473, 'n_tokens_neox': 436, 'n_words': 193}