Copy link to clipboard
Copied
Code:
<cffunction name="computeHash" access="public" returntype="String">
<cfargument name="password" type="string" />
<cfargument name="salt" type="string" />
<cfargument name="iterations" type="numeric" required="false" default="1024" />
<cfargument name="algorithm" type="string" required="false" default="SHA512" />
<cfscript>
var hashed = '';
var i = 1;
hashed = hash( password & salt, arguments.algorithm, 'UTF-8' );
for (i = 1; i <= iterations; i++) {
hashed = hash( hashed & salt, arguments.algorithm, 'UTF-8' );
}
return hashed;
</cfscript>
</cffunction>
Error on web app:
Context validation error for tag cfscript. | |
The start tag must have a matching end tag. An explicit end tag can be provided by adding </cfscript>. If the body of the tag is empty you can use the shortcut <cfscript .../>. The CFML compiler was processing:
| |
The error occurred in xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\salty.cfc: line 11 | |
9 : <cfargument name="iterations" type="numeric" required="false" default="1024" /> |
I am completely lost on why it's fumbling with why it says there's no closing tag. Help!!!!
Thanks
What's on lines 1-7 of that file?
That code compiles fine for me on CF8 & CF9, so that's not where the error is.
You're not trying to compile it on any earlier version of CF than CF8 are you? The < and ++ operators are not valid prior to CF8. CFMX7 might see the < as a stray angle bracket, and get confused. I don't have CFMX7 running here to test the exact error that would produce, sorry.
--
Adam
Copy link to clipboard
Copied
What's on lines 1-7 of that file?
That code compiles fine for me on CF8 & CF9, so that's not where the error is.
You're not trying to compile it on any earlier version of CF than CF8 are you? The < and ++ operators are not valid prior to CF8. CFMX7 might see the < as a stray angle bracket, and get confused. I don't have CFMX7 running here to test the exact error that would produce, sorry.
--
Adam
Copy link to clipboard
Copied
I am running MX7.
Looks like you are correct.
Also, my algorithm apparently isn't supported in CF7 either
edit: nvm, it's not SHA512, it's SHA-512 in CF7.