<commit_before>
import Cookie
import hashlib
import os
import random
import re
import string
import unicodedata
from datetime import datetime, timedelta

def random_string(size=6, chars=string.ascii_letters + string.digits):
    """ Generate random string """
    return ''.join(random.choice(chars) for _ in range(size))

def hashing(plaintext, salt="", sha="512"):
    # TODO: rename to hashing
    """ Returns the encrypted hexdigest of a plaintext and salt"""

    if sha == "1":
        phrase = hashlib.sha1()
    elif sha == "256":
        phrase = hashlib.sha256()
    else:
        phrase = hashlib.sha512()
    phrase.update("%s@%s" % (plaintext, salt))
    return phrase.hexdigest()

def encode(plainText):
    num = 0
    key = "<KEY>"
    key += "<KEY>"
    for c in plainText: num = (num << 8) + ord(c)
    encodedMsg = ""
    while num > 0:
        encodedMsg = key[num % len(key)] + encodedMsg
        num /= len(key)
    return encodedMsg

def decode(encodedMsg):
    num = 0
    key = "<KEY>"
    key += "<KEY>"<commit_msg>rename 'encrypt' function for 'hashing'<commit_after>
import Cookie
import hashlib
import os
import random
import re
import string
import unicodedata
from datetime import datetime, timedelta

def random_string(size=6, chars=string.ascii_letters + string.digits):
    """ Generate random string """
    return ''.join(random.choice(chars) for _ in range(size))

def hashing(plaintext, salt="", sha="512"):
    """ Returns the encrypted hexdigest of a plaintext and salt"""

    if sha == "1":
        phrase = hashlib.sha1()
    elif sha == "256":
        phrase = hashlib.sha256()
    else:
        phrase = hashlib.sha512()
    phrase.update("%s@%s" % (plaintext, salt))
    return phrase.hexdigest()

def encode(plainText):
    num = 0
    key = "<KEY>"
    key += "<KEY>"
    for c in plainText: num = (num << 8) + ord(c)
    encodedMsg = ""
    while num > 0:
        encodedMsg = key[num % len(key)] + encodedMsg
        num /= len(key)
    return encodedMsg

def decode(encodedMsg):
    num = 0
    key = "<KEY>"
    key += "<KEY>"
{'fraction_non_alphanumeric': 0.136669874879692, 'fraction_numerical': 0.01828681424446583, 'mean_word_length': 3.0135135135135136, 'pattern_counts': {'":': 4, '<': 15, '<?xml version=': 0, '>': 13, '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': '6760312', 'n_tokens_mistral': 695, 'n_tokens_neox': 654, 'n_words': 205}