Skip to content

Instantly share code, notes, and snippets.

@StuStirling
Created July 20, 2017 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StuStirling/1a309435d8bea6cecac630cea22b53fe to your computer and use it in GitHub Desktop.
Save StuStirling/1a309435d8bea6cecac630cea22b53fe to your computer and use it in GitHub Desktop.
Some useful File extensions
/**
* Generates a checksum for a file.
*/
fun File.checksum() : Long? {
val crc = CRC32()
crc.update(readBytes())
return crc.value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment