1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

fixes #267: include filenames in checksums

This commit is contained in:
DevCharly 2016-07-08 22:02:42 +02:00
parent 973ed30d18
commit da5f7fd4d3

View file

@ -24,7 +24,7 @@ public class Md5 {
* a checksum of the last modified timestamp.
*/
fun toMd5Directories(filesOrDirectories: List<File>,
toBytes: (File) -> ByteArray = { it.lastModified().toString().toByteArray() } ): String? {
toBytes: (File) -> ByteArray = { "${it.path} ${it.lastModified()} ${it.length()}".toByteArray() } ): String? {
if (filesOrDirectories.any { it.exists() }) {
MessageDigest.getInstance("MD5").let { md5 ->
var fileCount = 0