import hashlib

import groestlcoin_hash

from pycoin.encoding.hexbytes import bytes_as_revhex


def sha256(data):
    return bytes_as_revhex(hashlib.sha256(data).digest())


def groestlHash(data):
    """Groestl-512 compound hash."""
    return bytes_as_revhex(groestlcoin_hash.getHash(data, len(data)))

@@ -13,33 +13,8 @@
 ib%0A%0A
-import groestlcoin_hash%0A%0A
 from
@@ -161,24 +161,24 @@
 Hash(data):%0A
-
     %22%22%22Groes
@@ -202,16 +202,226 @@
 ash.%22%22%22%0A
+    try:%0A        import groestlcoin_hash%0A    except ImportError:%0A        t = 'Groestlcoin requires the groestlcoin_hash package (%22pip install groestlcoin_hash%22).'%0A        print(t)%0A        raise ImportError(t)%0A%0A
     retu

Raise ImportError when GRS is used without dependency