You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this case, the hash is generated from the content of your file, so it makes sense that it consumes the Source object. The file has to be read to build a hash.
You have two other options:
Reset the Source object after you're done generating the hash
Use a Tap instead of directly building the hash. This allows the digest to be constructed passively as some other piece of code reads your source. Like this:
valsource=Algo.crc32.tap( Source.fromFile("data.csv") )
source.getLines.foreach( line => {
// Application logic to process each line
println(line)
})
println( "Hash: "+ source.hash )
How I can do something like:
without empty my source iterator?. What's the correct way to calculate a Source's hash?
The text was updated successfully, but these errors were encountered: