我使用 Alteryx R 工具来签署亚马逊 http 请求。为此,我需要摘要包中包含的 hmac 函数。
我正在使用包含密钥和日期戳的文本输入工具。
Key= "foo"
datastamp= "20120215"
这就是问题所在。当我运行以下脚本时:
the.data <- read.Alteryx("1", mode="data.frame")
write.Alteryx(base64encode(hmac(the.data$key,the.data$datestamp,algo="sha256",raw = TRUE)),1)
与运行以下命令相比,我得到的结果不正确:
write.Alteryx(base64encode(hmac("foo","20120215",algo="sha256",raw = TRUE)),1)
不同之处在于,当我对键和对象的值进行硬编码时,我得到了正确的结果。但是,如果使用 R 数据框中的变量,我会得到不正确的输出。
数据框是否以某种方式改变了数据。有没有人在使用 Alteryx 中的 R 工具时遇到过这个问题。
感谢您的输入。