What would this be in Rev?

Bill Vlahos bvlahos at mac.com
Sun Mar 8 23:55:15 EDT 2009


Sorry I wasn't clear. These are snippets of code which I believe is  
from C (I don't actually know). They are part of a key generation  
system so the comments about encoding and then decoding in the  
snippets of code are correct. I'm trying to encode a license key and  
then decode it later.

I can translate the rest of the code syntax not presented but I had  
trouble with the lines I gave in the original email.

Bill Vlahos

On Mar 8, 2009, at 4:04 PM, Brian Yennie wrote:

> Bill,
>
> Do you know what language this is from? It has C-style syntax and  
> strcat is a fairly standard function, but I've never seen strindex()  
> used like that with 3 parameters.
> Do you know what the code is supposed to do? The variable names  
> aren't very revealing, and it seems to be concatenating 3 variables  
> and then turning around and extracting them back out.
>
> Then, at the end, it's calculating a hash of two values (str and  
> seed) which don't exist elsewhere in the code.
>
> I think you'll need to know more about the context and purpose here  
> to have a shot at translating it -- I doubt this snippet would  
> compile in its original language on its own.
>
> HTH,
> Brian
>
>> I have some code from another language that I want to run in Rev.  
>> What is the Rev equivalent for these commands?
>>
>> baseKey = strcat(myVariable, strcat(myVariable2,myVariable3))
>> myVariable = strindex(1,1 baseKey)
>> myVariable2 = strindex(2,2, baseKey)
>> myVariable3 = strindex(20,3, baseKey)
>>
>>
>> caculatedMD5 = strstr(
>>                              md5(
>>                                      strcat(
>>                                              lowercase(str),
>>                                              lowercase(seed)))
>>                              ,20)
>>
>>
>>
>> I don't know if there should be a comma after the second 1 in the  
>> second example or not but that is the way I have it.
>>
>> Thanks,
>> Bill Vlahos
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list