Sha256: 18f6707552ea2a1a35543fa2931eadb5d25290ed0297ccad702379b6fc6fa516
Contents?: true
Size: 906 Bytes
Versions: 33
Compression:
Stored size: 906 Bytes
Contents
# frozen_string_literal: true require "minitest/autorun" require "argon2id" class TestVerify < Minitest::Test def test_returns_true_with_correct_password assert Argon2id.verify( "$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4", "password" ) end def test_returns_false_with_incorrect_password refute Argon2id.verify( "$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4", "not password" ) end def test_raises_if_given_invalid_encoded assert_raises(ArgumentError) do Argon2id.verify("", "opensesame") end end def test_raises_if_given_encoded_with_null_byte assert_raises(ArgumentError) do Argon2id.verify( "$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4\x00foo", "password" ) end end end
Version data entries
33 entries across 33 versions & 1 rubygems