lime icon indicating copy to clipboard operation
lime copied to clipboard

neko md5.make return wrong value

Open dzw opened this issue 7 years ago • 1 comments

public function md55test() {
	var bitmapData = new BitmapData(64, 64, true, 0);

	var png_output_name = "E:\\wangwei\\tptest\\idle\\S\\00000_0_0.png";
	trace("write:" + png_output_name);

	var png_bytes:ByteArray = bitmapData.encode(bitmapData.rect, new PNGEncoderOptions());
	File.saveBytes(png_output_name, png_bytes);

	var md5sum_from_png = Md5.make(png_bytes).toHex();
	trace("md5sum from png endoce:" + md5sum_from_png); // wrong

	var file_bytes = File.getBytes(png_output_name);
	var md5sum_from_file = Md5.make(file_bytes).toHex();
	trace("md5sum from file:" + md5sum_from_file); // correct
}

md5sum_from_png and md5sum_from_file are different

SpriteSplit.hx:52: md5sum from png endoce:521212c2640c450cd9af0fb0de27b0eb SpriteSplit.hx:58: md5sum from file:28b45dc5da12aa945b75407a7142680f

cpp is ok neko is wrong i don't known where to report

dzw avatar Nov 09 '18 09:11 dzw

I wonder if the bytes are different even before Md5.make(). Might be some kind of file access irregularity.

player-03 avatar Apr 10 '23 05:04 player-03

It works fine for me. Perhaps this was fixed on the Haxe side of things?

If it's not fixed, I suggest reporting it to Haxe instead. Both File and Md5 are standard library classes, and the problem would lie in one of those.

player-03 avatar Oct 23 '25 04:10 player-03