tuned signature;
authorwenzelm
Wed, 12 Jun 2024 21:44:30 +0200
changeset 80360 6ea999f55c2d
parent 80359 bb4e95d19ecb
child 80361 54a83e8e447b
tuned signature;
src/Pure/General/bytes.scala
src/Pure/General/sha1.scala
--- 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))