How to calculate CRC checksum in Actionscript 3?

倾然丶 夕夏残阳落幕 提交于 2019-12-25 02:55:57

问题


I am developing an application in flex in which I need to calculate checksum of different files. I would like to know if there is a direct method in actionscript to calculate that or do I have to go for any external libraries?

Thanks in advance :)


回答1:


as3corelib maintained by Mike Chambers/Adobe, contains everything you probably need in its crypto section including:

  • HMAC
  • MD5
  • MD5Stream
  • SHA1
  • SHA224
  • SHA256
  • WSSEUsernameTocken



回答2:


how do you use this as3corelib to perform a md5 on a file i.e. "c:\documents and settings\all user\desktop\demofile.xml" in php and c# you can md5files and get the checksum of the file - i also use md5summer to see if the outputted md5 is correct php and visual c# output the correct md5 however i cant find any easy tut that explains how to do this using flex / air / as3 nothing - i have imported the followinng libs.

import com.adobe.crypto.HMAC; import com.adobe.crypto.MD5; import com.adobe.crypto.SHA1; import com.adobe.crypto.SHA224; import com.adobe.crypto.SHA256; import com.adobe.crypto.MD5Stream;

i would have though that it would be md5stream be googling this turns up nought - please any help on how to do a simple md5 checksum of a local file would be great!!




回答3:


Check out this script. I think it will do what you have in mind:

http://code.google.com/p/queueloader-as3/source/browse/trunk/build/src/nochump/util/zip/CRC32.as?r=57



来源:https://stackoverflow.com/questions/3459953/how-to-calculate-crc-checksum-in-actionscript-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!