2019-04-29 19:27:42 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-01-09 05:18:21 -06:00
|
|
|
require "pbkdf2"
|
2013-03-06 06:12:16 -06:00
|
|
|
|
2022-07-27 21:27:38 -05:00
|
|
|
RSpec.describe Pbkdf2 do
|
2017-07-27 20:20:09 -05:00
|
|
|
# trivial test to ensure this does not regress during extraction
|
|
|
|
it "hashes stuff correctly" do
|
2023-01-09 05:18:21 -06:00
|
|
|
expect(Pbkdf2.hash_password("test", "abcd", 100)).to eq(
|
|
|
|
"0313a6aca54dd4c5d82a699a8a0f0ffb0191b4ef62414b8d9dbc11c0c5ac04da",
|
|
|
|
)
|
|
|
|
expect(Pbkdf2.hash_password("test", "abcd", 101)).to eq(
|
|
|
|
"c7a7b2891bf8e6f82d08cf8d83824edcf6c7c6bacb6a741f38e21fc7977bd20f",
|
|
|
|
)
|
2013-03-06 06:12:16 -06:00
|
|
|
end
|
|
|
|
end
|