Learn R Programming

REDCapR (version 0.9.8)

sanitize_token: Validate and sanitize the user's REDCap token.

Description

Verifies the token is nonmissing and conforms to the legal pattern of a 32-character hexadecimal value. Trailing line endings are removed.

Usage

sanitize_token(token)

Arguments

token

The REDCap token. Required.

Value

The token, without a terminal newline character.

Examples

Run this code
# NOT RUN {
library(REDCapR) #Load the package into the current R session.
secret_token_1 <- "12345678901234567890123456ABCDEF"
secret_token_2 <- "12345678901234567890123456ABCDEF\n"
sanitize_token(secret_token_1)
sanitize_token(secret_token_2)
# }

Run the code above in your browser using DataLab