Closed guoyiheng closed 3 years ago
On calling spark.end()
the internal spark state resets itself (see line: 506 - https://github.com/satazor/js-spark-md5/blob/c3d964c605befba62d608d2c0fe3dfbf06e251fb/spark-md5.js#L506)
The work around for this could be to save the current state and reset the state immediately before calling spark.end()
again.
e.g.
const sparkState = spark.getState();
console.log('Correct MD5', spark.end());
console.log('Reset MD5', spark.end());
spark.setState(sparkState);
console.log('Correct MD5, spark.end());
I understand, thank you
worng code:
spark.end()
executed twicetrue code:
I found that the results after two executions are different. the executions code is
spark.end()
I didn't look at the source code carefully, so I hope the author answers