Re: PHP To Cold Fusion
1) No, that wont work. toBase64(hash('testing', SHA-256)) gets you close but hash_hmac is a very specific PHP function in what it does. Is there a way you can use a different method to generate that signature or are you trying to maintain backward compatibility? Alternately, heres a UDF designed to emulate that function: http://www.isummation.com/blog/calculate-hmac-sha256-digest-using-user-defined-function-in-coldfusion/ 2) No, time() in PHP returns a unix timestamp. You want: DateDiff(s, CreateDate(1970,1,1), Now()) On Jan 16, 2015, at 9:39 AM, Robert Harrison rharri...@aimg.com wrote: I have an API I need to work with. No problem converting most to ColdFusion, but two strings I'm unsure of: 1. The PHP encode format is: $signature = base64_encode(hash_hmac('sha256', $mystring, true)); I think in CF the equivalent would be: cfset signature=hash(mystring, SHA-256, Base64) 2. The other part is : $ts=time(); Not sure what format the above outputs. Could it be the same as: cfset ts=now() Any thoughts? Thanks Robert Harrison Full Stack Developer AIMG mailto:rharri...@aimg.com rharri...@aimg.com Main Office: 704-321-1234 ext.121 Direct Line: 516-302-4345 http://www.aimg.com/ www.aimg.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359980 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: PHP To Cold Fusion
2. The epoch is GMT and using the ColdFusion now() function returns local time, not GMT. This is a more accurate epoch value: left(GetTickCount(), 10) On Fri, Jan 16, 2015 at 1:04 PM, Jon Clausen jon_clau...@silowebworks.com wrote: 1) No, that wonât work. toBase64(hash('testing', SHA-256)) gets you close but hash_hmac is a very specific PHP function in what it does. Is there a way you can use a different method to generate that signature or are you trying to maintain backward compatibility? Alternately, hereâs a UDF designed to emulate that function: http://www.isummation.com/blog/calculate-hmac-sha256-digest-using-user-defined-function-in-coldfusion/ 2) No, time() in PHP returns a unix timestamp. You want: DateDiff(s, CreateDate(1970,1,1), Now()) On Jan 16, 2015, at 9:39 AM, Robert Harrison rharri...@aimg.com wrote: I have an API I need to work with. No problem converting most to ColdFusion, but two strings I'm unsure of: 1. The PHP encode format is: $signature = base64_encode(hash_hmac('sha256', $mystring, true)); I think in CF the equivalent would be: cfset signature=hash(mystring, SHA-256, Base64) 2. The other part is : $ts=time(); Not sure what format the above outputs. Could it be the same as: cfset ts=now() Any thoughts? Thanks Robert Harrison Full Stack Developer AIMG mailto:rharri...@aimg.com rharri...@aimg.com Main Office: 704-321-1234 ext.121 Direct Line: 516-302-4345 http://www.aimg.com/ www.aimg.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359982 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: PHP To Cold Fusion
And itâs simpler, to boot! What he said. :) On Jan 16, 2015, at 1:19 PM, Michael Dinowitz mdino...@houseoffusion.com wrote: 2. The epoch is GMT and using the ColdFusion now() function returns local time, not GMT. This is a more accurate epoch value: left(GetTickCount(), 10) On Fri, Jan 16, 2015 at 1:04 PM, Jon Clausen jon_clau...@silowebworks.com wrote: 1) No, that wonâÂÂt work. toBase64(hash('testing', SHA-256)) gets you close but hash_hmac is a very specific PHP function in what it does. Is there a way you can use a different method to generate that signature or are you trying to maintain backward compatibility? Alternately, hereâÂÂs a UDF designed to emulate that function: http://www.isummation.com/blog/calculate-hmac-sha256-digest-using-user-defined-function-in-coldfusion/ 2) No, time() in PHP returns a unix timestamp. You want: DateDiff(s, CreateDate(1970,1,1), Now()) On Jan 16, 2015, at 9:39 AM, Robert Harrison rharri...@aimg.com wrote: I have an API I need to work with. No problem converting most to ColdFusion, but two strings I'm unsure of: 1. The PHP encode format is: $signature = base64_encode(hash_hmac('sha256', $mystring, true)); I think in CF the equivalent would be: cfset signature=hash(mystring, SHA-256, Base64) 2. The other part is : $ts=time(); Not sure what format the above outputs. Could it be the same as: cfset ts=now() Any thoughts? Thanks Robert Harrison Full Stack Developer AIMG mailto:rharri...@aimg.com rharri...@aimg.com Main Office: 704-321-1234 ext.121 Direct Line: 516-302-4345 http://www.aimg.com/ www.aimg.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359983 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: PHP To Cold Fusion
Thanks. I got through that one. Now I'm trying to set up the call rail API. Anyone done that in CF before? Thanks Robert Harrison Full Stack Developer AIMG rharri...@aimg.com Main Office: 704-321-1234 ext.121 Direct Line: 516-302-4345 www.aimg.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359984 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: PHP To Cold Fusion
The Y2K in me says this would be better ;-) int(getTickCount()/1000) On Fri, Jan 16, 2015 at 1:19 PM, Michael Dinowitz mdino...@houseoffusion.com wrote: 2. The epoch is GMT and using the ColdFusion now() function returns local time, not GMT. This is a more accurate epoch value: left(GetTickCount(), 10) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359986 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: PHP vs. Cold Fusion
To get you started: http://www.zdnet.com/enterprise/stories/linux/0,12249,2646052,00.html http://www.zdnet.com/eweek/stories/general/0,11011,2646051,00.html Benjamin S. Rogers Web Developer, c4.net Voice: (508) 240-0051 Fax: (508) 240-0057 -Original Message- From: Alex Puritche [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 28, 2001 3:15 PM To: CF-Talk Subject: PHP vs. Cold Fusion Hi, folks! I'll highly appreciate if somebody can send me URL of the page where I can read performance comparison of the both techniques, of course if somebody has it own experience in such things then I'll get to know it with increased attention! P.S. I'm a bit abashed because of my English. I'm sorry. English isn't my native language. -- Regards, Alex mailto:[EMAIL PROTECTED] May all your Internet Dreams come true! http://www.intellinetusa.com/ ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: PHP vs. Cold Fusion
Alex, Go to www.php.net or www.zend.com for information about php versus CF. I used to work as a web developer using php 3/4 and found that is was very easy to use (very close to C\C++ as well as Java). I liked php because it was quick and easy to turn out code. However, I am still new to CF so this last observation is biased because I am still learning CF. However, the experts that I have read will tell which one is better based on what their experience has been with that language. As far as I am concerned, they both are about the same. They both have their +'s and -'s. The decision is really up to you. - Original Message - From: "Alex Puritche" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Wednesday, February 28, 2001 2:15 PM Subject: PHP vs. Cold Fusion Hi, folks! I'll highly appreciate if somebody can send me URL of the page where I can read performance comparison of the both techniques, of course if somebody has it own experience in such things then I'll get to know it with increased attention! P.S. I'm a bit abashed because of my English. I'm sorry. English isn't my native language. -- Regards, Alex mailto:[EMAIL PROTECTED] May all your Internet Dreams come true! http://www.intellinetusa.com/ ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: PHP vs. Cold Fusion
Here are a few links: http://www.zdnet.com/eweek/stories/general/0,11011,2646051,00.html http://php.weblogs.com/php_vs_cold_fusion HTH, Howie Hamlin - inFusion Project Manager On-Line Data Solutions, Inc. www.CoolFusion.com 631-737-4668 x101 inFusion Mail Server (iMS) - the World's most configurable mail server Get your free copy of iMS POST-SE Server from CoolFusion! - Original Message - From: "Alex Puritche" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Wednesday, February 28, 2001 3:15 PM Subject: PHP vs. Cold Fusion Hi, folks! I'll highly appreciate if somebody can send me URL of the page where I can read performance comparison of the both techniques, of course if somebody has it own experience in such things then I'll get to know it with increased attention! P.S. I'm a bit abashed because of my English. I'm sorry. English isn't my native language. -- Regards, Alex mailto:[EMAIL PROTECTED] May all your Internet Dreams come true! http://www.intellinetusa.com/ ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists