--- a/src/Pure/General/bytes.scala Wed Jun 12 21:40:13 2024 +0200
+++ b/src/Pure/General/bytes.scala Wed Jun 12 21:44:30 2024 +0200
@@ -158,8 +158,7 @@
/* content */
lazy val sha1_digest: SHA1.Digest =
- if (is_empty) SHA1.digest_empty
- else SHA1.make_digest { sha => sha.update(bytes, offset, length) }
+ if (is_empty) SHA1.digest_empty else SHA1.digest(bytes, offset, length)
def is_empty: Boolean = length == 0
--- a/src/Pure/General/sha1.scala Wed Jun 12 21:40:13 2024 +0200
+++ b/src/Pure/General/sha1.scala Wed Jun 12 21:44:30 2024 +0200
@@ -49,6 +49,8 @@
def digest(path: Path): Digest = digest(path.file)
def digest(bytes: Array[Byte]): Digest = make_digest(_.update(bytes))
+ def digest(bytes: Array[Byte], offset: Int, length: Int): Digest =
+ make_digest(_.update(bytes, offset, length))
def digest(bytes: Bytes): Digest = bytes.sha1_digest
def digest(string: String): Digest = digest(Bytes(string))