Search found 131 matches

by Ledigimate
Sun Dec 16, 2018 8:39 pm
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 1737

Re: Circular shift

Hello Craig

Yes I want to do something like that, only it needs to be a bitwise rotation of the individual bits of a 32-bit register, e.g. the number 1234 becomes the number 4644 if you rotate the bits left by 1 position.

edit: sorry, my example is 12-bit integer, not a 32-bit integer
by Ledigimate
Sun Dec 16, 2018 7:08 pm
Forum: Talking LiveCode
Topic: Circular shift
Replies: 20
Views: 1737

Circular shift

Hi I'm looking for a way to perform circular shift operations in LiveCode, like can be done in the C language using the bitwise operators << and >>. I could find only these four bitwise operators in the LC dictionary: bitAnd, bitOr, bitXor, and bitNot. Can someone point me in the right direction? Ge...
by Ledigimate
Sat Dec 15, 2018 2:04 pm
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 1741

Re: [Solved] md5digest of large files, how reliable is it?

From the dictionary entry to messageDigest , introduced in LC 9: MD5 is cryptographically broken and unsuitable for further use. Do not use for security-critical purposes, unless required for backward compatibility with existing systems. Thank you, Hermann. I only needed it for checksum purposes.
by Ledigimate
Sat Dec 15, 2018 8:54 am
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 1741

Re: md5digest of large files, how reliable is it?

Thank you Richard! I wasn't aware of the sysError function. It yielded system error code 8, which translates to insufficient memory. I can now conclude that in order for the md5Digest function to compute the md5 checksum of a file, the entire file would need to be loaded into a string variable. The ...
by Ledigimate
Thu Dec 13, 2018 7:13 pm
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 1741

Re: md5digest of large files, how reliable is it?

Double check that first argument. Options are provided for most data sizes in both byte orders. Thanks Richard, that was it. I couldn't make sense of the relevant dictionary entry from inside LC, so I looked it up online and even there I had to decipher the text which wasn't properly punctuated. Bu...
by Ledigimate
Thu Dec 13, 2018 9:30 am
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 1741

Re: md5digest of large files, how reliable is it?

After some more testing, I also discovered that the binarydecode function swaps the hex characters in the result when asked to decode binary data to hex data, e.g. it yields 9c0f8f59bf89ba19955ff10d92e732d6 instead of c9f0f895fb98ab9159f51fd0297e236d Why on earth would it do that? Or is the md5Diges...
by Ledigimate
Thu Dec 13, 2018 12:23 am
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 1741

Re: md5digest of large files, how reliable is it?

Which OS are you using? Any version of Windows from XP up to 10. Many provide hashing functions that can be called from the command line via LC's shell function. I have a command line utility from Microsoft that can do the job, but I just wanted to try the LC function first. If it could spare me so...
by Ledigimate
Wed Dec 12, 2018 11:17 pm
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 1741

Re: md5digest of large files, how reliable is it?

How large is "large"?
Files that are too large to be loaded entirely into RAM, I guess.
Once generated, how is the md5 value being used?
I would like to use the md5 value to verify the integrity of a copied file.
by Ledigimate
Wed Dec 12, 2018 4:45 pm
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 1741

Re: md5digest of large files, how reliable is it?

If you pass a file URL to the md5Digest function, does it always read the whole file? If not, that might explain why I got the same value for two very large files that differ by only one bit. I made a copy of a 3.04 GB file, changed only one bit using a raw disk editor, ran the function against both...
by Ledigimate
Wed Dec 12, 2018 3:00 pm
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 1741

Re: md5digest of large files, how reliable is it?

I just tested the above code on two large files that differ by a single bit.
The result is disappointing.
It returns the same result for both files.
So now my question becomes, am I going about this the wrong way?
by Ledigimate
Wed Dec 12, 2018 1:37 pm
Forum: Talking LiveCode
Topic: [Solved] md5digest of large files, how reliable is it?
Replies: 21
Views: 1741

[Solved] md5digest of large files, how reliable is it?

Hi I've tested LiveCode's md5digest function and its super fast, even with files larger in size than the computer's RAM. function fileMd5Digest pFilePath local tCheckSum get binarydecode("h*", md5digest(url ("binfile:" & pFilePath)), tCheckSum) return tCheckSum end fileMd5Digest I just don't know ho...
by Ledigimate
Thu May 25, 2017 8:33 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: IP to Decimal converter
Replies: 3
Views: 930

Re: IP to Decimal converter

Okay, here it is :D

- Gerrie
by Ledigimate
Tue May 23, 2017 10:37 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: IP to Decimal converter
Replies: 3
Views: 930

Re: IP to Decimal converter

Thank you Richmond. I thought it might be useful if the decimal number could also be converted back to an IP address, so I gave it a try: set the itemdelimiter to "." if fld "DEK" is an integer then put fld "DEK" into tNum put tNum div (256^3) into fld "EYEPEE" subtract fld "EYEPEE" * (256^3) from t...
by Ledigimate
Tue May 23, 2017 9:48 pm
Forum: Talking LiveCode
Topic: Filling Out Data Grid With Tab Delimited Data Problem
Replies: 2
Views: 943

Re: Filling Out Data Grid With Tab Delimited Data Problem

Hi Nalot It sounds like the "Delays_List" datagrid is broken and you may have to re-create it. Setting the dgtext of a working datagrid should not create a custom property called dgtext! Or perhaps the datagrid's parent group is the same size as the datagrid itself, making it seem like you've select...
by Ledigimate
Wed Mar 29, 2017 7:39 pm
Forum: CGIs and the Server
Topic: Nesting arrays in $_SESSION
Replies: 1
Views: 1325

Re: Nesting arrays in $_SESSION

What if you put $_SESSION["policies"] into its own variable, modify it, and put it back into $_SESSION["policies"]? put $_SESSION["policies"] into policies #... put revDatabaseColumnNamed(tCursor, "policy_date_expiry_actual_aec") into policies[i]["actual_expiry_date"] #... put policies into $_SESSIO...

Go to advanced search