1
我這樣做了,但Adobe Air掛了幾秒鐘。Adobe AIR。獲取文件的MD5
private function test():void
{
fileStream = new FileStream();
fileStream.addEventListener(IOErrorEvent.IO_ERROR, fileError);
fileStream.addEventListener(Event.COMPLETE, opened);
fileStream.openAsync(filePath, FileMode.READ);
}
protected function opened(event:Event):void
{
var bytes:ByteArray = new ByteArray();
fileStream.readBytes(bytes);
fileStream.close();
// MD5Stream from package com.adobe.crypto.MD5Stream https://github.com/mikechambers/as3corelib/blob/master/src/com/adobe/crypto/MD5Stream.as
var md5stream:MD5Stream = new MD5Stream;
trace(md5stream.complete(bytes)); // md5
}
如何使md5不掛起的過程?
必須是一個大文件。分解成碎片也許? – 2012-02-17 17:40:36