tag:blogger.com,1999:blog-5843977256413530490.post683076651941569877..comments2024-01-09T23:50:14.690-06:00Comments on Tech Art Tiki: Checksums in 3ds Max (part 1 of 2)Unknownnoreply@blogger.comBlogger11125tag:blogger.com,1999:blog-5843977256413530490.post-40114631927094778882011-09-07T13:59:23.853-05:002011-09-07T13:59:23.853-05:00Thank you so much for this! I don't have time...Thank you so much for this! I don't have time to try and understand it atm but it took my scene from 1200 materials down to 12 - possibly saving years of my life.<br /><br />Much appreciated!!Unknownhttps://www.blogger.com/profile/17856250964017288951noreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-11937111925458638582010-10-26T15:22:01.139-05:002010-10-26T15:22:01.139-05:00@Trevor,
That's exactly what I did. Look abov...@Trevor,<br />That's exactly what I did. Look above, from with the paragraph starting with "If you don't mind a little more setup..."Adam Pletcherhttps://www.blogger.com/profile/10166087039826579621noreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-77576166607031914582010-10-26T14:54:24.300-05:002010-10-26T14:54:24.300-05:00You could also do it using Pythons built-in hashli...You could also do it using Pythons built-in hashlib. This will compute an MD5 digest which will match with other MD5 tools out there.<br /><br />import hashlib<br />def strChecksum(s):<br /> """Return checksum for the given string"""<br /> m = hashlib.md5()<br /> m.update(s)<br /> return m.hexdigest()Trevorhttps://www.blogger.com/profile/13967799686080003651noreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-40187507483201771412008-08-10T03:18:00.000-05:002008-08-10T03:18:00.000-05:00Oks, when I posted the reply (very late at night o...Oks, when I posted the reply (very late at night over here :D ) I realized that the returned array was actually the same as it would be from Python's MD5 has function, the only difference is that the array is in a decimal form.<BR/><BR/>A simple function for re-formatting the array of decimals into a whole string representing a hexadecimal conversion will do. Just store the array in a variable called "hashArr" and convert it like so:<BR/><BR/>for o in hashArr do<BR/>(<BR/>tmpTxt += formattedPrint o format:"x"<BR/>)<BR/><BR/>This is the result of a MD5 has for "DUBER.CZ" from within MAXScript:<BR/><BR/>"c1e88352c1c25c5aa01d6d504e8d8d39"<BR/><BR/>and this is Python's MD5 has output:<BR/><BR/>"c1e88352c1c25c5aa01d6d504e8d8d39"loocashttps://www.blogger.com/profile/09595085938960679120noreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-8091475950610455012008-08-09T18:55:00.000-05:002008-08-09T18:55:00.000-05:00You can easily utilize .NET classes for such a tas...You can easily utilize .NET classes for such a task.<BR/><BR/>Here's a sample code for hashing your strings using the MD5 algorithm returning a byte array:<BR/><BR/>md5Class = dotNetClass "System.Security.Cryptography.MD5"<BR/>encoding = dotNetClass "System.Text.Encoding"<BR/><BR/>myString = "DUBER.CZ"<BR/><BR/>MD5 = md5Class.Create()<BR/>MD5.ComputeHash(encoding.ASCII.GetBytes(myString))<BR/><BR/>I'll look deeper into the whole .NET hashing methods as this isn't the same hex value you can get from Python. But it should give you an idea about accessing .NET classes and using their properties :)<BR/><BR/>Hope it helps, cheers,<BR/><BR/>- loocasloocashttps://www.blogger.com/profile/09595085938960679120noreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-78859382970805203952008-07-23T11:50:00.000-05:002008-07-23T11:50:00.000-05:00@matt clark,MaxScript has no native checksum metho...@matt clark,<BR/>MaxScript has no native checksum methods, MD5 or otherwise. It's possible you could do something via .NET in the newer releases, but I haven't looked.<BR/><BR/>@anonymous,<BR/>You could make something work with matchPattern, yeah. Although that only returns true/false and what we're really after is the char's position in the key string. You'd need to work in subString or something similar on top of it.Adam Pletcherhttps://www.blogger.com/profile/10166087039826579621noreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-45775590681583303672008-07-23T10:45:00.000-05:002008-07-23T10:45:00.000-05:00You can use "matchpattern" instead of findstring t...You can use "matchpattern" instead of findstring to get round the case sensitive issue.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-41038130441634255682008-07-23T10:38:00.000-05:002008-07-23T10:38:00.000-05:00Is MD5 actually doable internally in Maxscript? If...Is MD5 actually doable internally in Maxscript? If not why is that? I was going to start looking into it myself.Unknownhttps://www.blogger.com/profile/06975155481003538224noreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-66063206653643501612008-07-14T19:05:00.000-05:002008-07-14T19:05:00.000-05:00Right you are, good catch. Probably not helping t...Right you are, good catch. Probably not helping the collisions issue, is it? :) Another reason not to use that implementation.Adam Pletcherhttps://www.blogger.com/profile/10166087039826579621noreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-62750437953387532202008-07-14T16:37:00.000-05:002008-07-14T16:37:00.000-05:00Correct me if I'm wrong, but are he caps in the al...Correct me if I'm wrong, but are he caps in the alphakey not a bit useless? As far as I know, findString is case insensitive.<BR/><BR/>For example, both "aaa" and "AAA" produce a checksum of 128.0.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5843977256413530490.post-11359740979832563842008-07-12T21:11:00.000-05:002008-07-12T21:11:00.000-05:00This comment has been removed by the author.Rob Galanakishttps://www.blogger.com/profile/06620179073714277865noreply@blogger.com