<commit_before>--
-- Created by IntelliJ IDEA.
-- User: alex
-- Date: 25/07/2015
-- Time: 15:35
-- To change this template use File | Settings | File Templates.
--
handle, msg = loadlib(getenv("LIBRARY_PATH"))

if (not handle or handle == -1) then
    error(msg)
end

callfromlib(handle, 'lua_lpbkdf2open')

local pwd_base64 = 'G8xbilfZyeNcYVAW3o9fs42l7hypVRec1XfdjoofPco='
local salt = '<PASSWORD>'
local iterations = 15000

-- testing
local hash_base64 = pbkdf2_hmac_sha256("teste", salt, iterations)

print(hash_base64, pwd_base64)
assert(hash_base64 == pwd_base64)

local i = 4
local rsalt
while (i < 512) do
    rsalt = rand_salt(i)
    print(i, rsalt, strlen(rsalt) == i)
    i = i ^ 2
 end<commit_msg>Novo modelo de teste.<commit_after>--
-- Created by IntelliJ IDEA.
-- User: alex
-- Date: 25/07/2015
-- Time: 15:35
-- To change this template use File | Settings | File Templates.
--
handle, msg = loadlib(getenv("LIBRARY_PATH"))

if (not handle or handle == -1) then
    error(msg)
end

callfromlib(handle, 'lua_lpbkdf2open')

local pwd_base64 = 'G8xbilfZyeNcYVAW3o9fs42l7hypVRec1XfdjoofPco='
local salt = '<PASSWORD>'
local iterations = 15000

-- testing
local hash_base64 = pbkdf2_hmac_sha256("teste", salt, iterations)

print(hash_base64, pwd_base64)
assert(hash_base64 == pwd_base64)

local i = 4
local rsalt
while (i < 128) do
    rsalt = rand_salt(i)
    print(i, rsalt, strlen(rsalt) == i)
    i = i * 2
 end
{'fraction_non_alphanumeric': 0.1271067415730337, 'fraction_numerical': 0.06601123595505617, 'mean_word_length': 4.10752688172043, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '1229829', 'n_tokens_mistral': 633, 'n_tokens_neox': 566, 'n_words': 146}