Learn R Programming

REDCapR (version 1.0.0)

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)

Value

The token, without a terminal newline character.

Arguments

token

The REDCap token. Required.

Author

Hao Zhu, Benjamin Nutter, Will Beasley

Examples

Run this code
secret_token_1 <- "12345678901234567890123456ABCDEF"
secret_token_2 <- "12345678901234567890123456ABCDEF\n"
REDCapR::sanitize_token(secret_token_1)
REDCapR::sanitize_token(secret_token_2)

Run the code above in your browser using DataLab