From 9858c9b91d1840483aca9e9f36690597d9a38f1d Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Wed, 2 Feb 2011 19:25:56 -0500 Subject: [PATCH] additional entry point in Hash --- util/io/Hash.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/io/Hash.scala b/util/io/Hash.scala index d8e3832f4..18f9fa29f 100644 --- a/util/io/Hash.scala +++ b/util/io/Hash.scala @@ -33,7 +33,9 @@ object Hash array } /** Calculates the SHA-1 hash of the given String.*/ - def apply(s: String): Array[Byte] = apply(new ByteArrayInputStream(s.getBytes("UTF-8"))) + def apply(s: String): Array[Byte] = apply(s.getBytes("UTF-8")) + /** Calculates the SHA-1 hash of the given Array[Byte].*/ + def apply(as: Array[Byte]): Array[Byte] = apply(new ByteArrayInputStream(as)) /** Calculates the SHA-1 hash of the given file.*/ def apply(file: File): Array[Byte] = Using.fileInputStream(file)(apply) /** Calculates the SHA-1 hash of the given stream, closing it when finished.*/