Created
July 20, 2017 14:18
-
-
Save StuStirling/1a309435d8bea6cecac630cea22b53fe to your computer and use it in GitHub Desktop.
Some useful File extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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