test_that("encryption works", {
computed_key <- encrypt_redcap_key("SecurePassword!!", "123456789ABCDEFGHIJKLMNOPQRSTUVW")
expect_false(is.null(computed_key))
expect_true(is.raw(computed_key))
})
test_that("password hash works", {
digested_password <- digest_passwd("SecurePassword!!")
expect_equal(length(digested_password), 32)
})
test_that("Data recovered", {
encrypted <- encrypt_redcap_key("SecurePassword!!", "123456789ABCDEFGHIJKLMNOPQRSTUVW")
decrypted <- decrypt_redcap_key("SecurePassword!!", encrypted)
expect_equal(decrypted, "123456789ABCDEFGHIJKLMNOPQRSTUVW")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.