From 5d11b62876f67c7245c7ba759be0eb4ff9b67aa8 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Wed, 6 Jul 2011 07:30:47 -0400 Subject: [PATCH] convenience for hashing String to a String --- util/io/Hash.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/util/io/Hash.scala b/util/io/Hash.scala index e627e16fa..fe6a47a75 100644 --- a/util/io/Hash.scala +++ b/util/io/Hash.scala @@ -33,6 +33,7 @@ object Hash array } def halve(s: String): String = if(s.length > 3) s.substring(0, s.length / 2) else s + def halfHashString(s: String): String = halve(toHex(apply(s))) /** Calculates the SHA-1 hash of the given String.*/ def apply(s: String): Array[Byte] = apply(s.getBytes("UTF-8"))