Files
shiny/examples/02_hash/app.R
Joe Cheng 41716d160b Change startApp/runApp signature
Also change example apps to launch directly using runApp
2012-07-18 09:00:32 -07:00

21 lines
435 B
R

library(shiny)
library(digest)
app <- function(input, output) {
text <- reactive(function() {
str <- input$input1
if (input$addnewline)
str <- paste(str, "\n", sep='')
return(str)
})
output$md5_hash <- reactive(function() {
digest(text(), algo='md5', serialize=F)
})
output$sha1_hash <- reactive(function() {
digest(text(), algo='sha1', serialize=F)
})
}
runApp(client='./www', server=app)