hkauroberoi

Joined

60 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in Can some explain this line of code

Perfect.. Thanks !!

Posted in Can some explain this line of code

Hello,

I'm following a RUBY code and writing a small script in php that will accept post request (json) and show values. However, the following line puzzles me - what does params["payload"] is doing ?

params = CGI::parse(post_body)
digest = Digest::SHA1.hexdigest(params[“payload”].to_json+secret_key)

{
"payload": {
"useriden": "900af657a65e",
"score": 50,
"Average": 25
},
"signature": "af886289"
}

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.