Re: Groovy Hash Calculations

2016-03-09 Thread Gerald Wiltse
ple, passing that input stream to another method >> that wrote the content to a file then you wanted to get the digest after >> the file write was complete. >> >> >> >> Jason >> >> >> >> *From:* Gerald Wiltse [mailto:jerrywil...@gmail.com] &g

Re: Groovy Hash Calculations

2016-03-09 Thread Gerald Wiltse
be dragons".bytes) > > println MessageDigest.getInstance("SHA1").digest(content.bytes).encodeHex() > > > > //If the content might be arbitrarily long: > > content = new ByteArrayInputStream("Here be dragons".bytes) > > def digest = MessageDigest.getInstanc

Re: Groovy Hash Calculations

2016-03-04 Thread Gerald Wiltse
ties Maintenance* > > O: 858-831-2209 > > C: 760-473-7542 > > H: 760-930-0461 > > erick.nel...@hdsupply.com > > > > *From:* Winnebeck, Jason [mailto:jason.winneb...@windstream.com] > *Sent:* Friday, March 04, 2016 6:40 AM > *To:* users@groovy.apache.org >

RE: Groovy Hash Calculations

2016-03-04 Thread Nelson, Erick [HDS]
-2209 C: 760-473-7542 H: 760-930-0461 erick.nel...@hdsupply.com<mailto:billy.polihrona...@hdsupply.com> From: Winnebeck, Jason [mailto:jason.winneb...@windstream.com] Sent: Friday, March 04, 2016 6:40 AM To: users@groovy.apache.org Subject: RE: Groovy Hash Calculations Here is how I would do

Re: Groovy Hash Calculations

2016-03-04 Thread Gerald Wiltse
le write was complete. > > > > Jason > > > > *From:* Gerald Wiltse [mailto:jerrywil...@gmail.com] > *Sent:* Friday, March 04, 2016 10:08 AM > *To:* users@groovy.apache.org > *Subject:* Re: Groovy Hash Calculations > > > > I'm trying to verify the sha

RE: Groovy Hash Calculations

2016-03-04 Thread Winnebeck, Jason
the content to a file then you wanted to get the digest after the file write was complete. Jason From: Gerald Wiltse [mailto:jerrywil...@gmail.com] Sent: Friday, March 04, 2016 10:08 AM To: users@groovy.apache.org Subject: Re: Groovy Hash Calculations I'm trying to verify the sha1 hash on a

Re: Groovy Hash Calculations

2016-03-04 Thread Gerald Wiltse
gons".bytes) > > def digest = MessageDigest.getInstance("SHA1") > > content.eachByte(4096) { bytes, len -> > > digest.update(bytes, 0, len) > > } > > println digest.digest().encodeHex() > > > > Jason > > > > *From:* Gerald Wiltse [mailto:jerrywil.

RE: Groovy Hash Calculations

2016-03-04 Thread Winnebeck, Jason
9:18 AM To: users@groovy.apache.org Subject: Groovy Hash Calculations Hello All, I have this block, it's pretty compressed, just wondering if there is a more groovy way to handle reading the buffer and computing the hash. def messageDigest = MessageDigest.getInstance("S

Groovy Hash Calculations

2016-03-04 Thread Gerald Wiltse
Hello All, I have this block, it's pretty compressed, just wondering if there is a more groovy way to handle reading the buffer and computing the hash. def messageDigest = MessageDigest.getInstance("SHA1") def dis = new DigestInputStream(content, messageDigest) byte[] buff