diff --git a/common/python/nomadcore/compact_sha.py b/common/python/nomadcore/compact_sha.py
index ed54b65ade314a1ffbe56efc24d208974bca5835..58fdaeaf35293e84bdcfa4979d0f91f17d184820 100644
--- a/common/python/nomadcore/compact_sha.py
+++ b/common/python/nomadcore/compact_sha.py
@@ -3,6 +3,7 @@ import hashlib
 import base64
 
 class CompactHash(object):
+    """compact sha can be used to calculate nomad gids"""
     def __init__(self, proto):
         self._proto = proto
 
@@ -18,14 +19,27 @@ class CompactHash(object):
             data=data.encode("utf-8")
         return self._proto.update(data)
 
+    def gid(self, prefix=""):
+        """returns a nomad gid with the given prefix"""
+        return prefix + self.b64digest()[:28]
+
     def __getattr__(self, name):
         return getattr(self._proto, name)
 
 def sha224(*args, **kwargs):
+    """CompactSha using sha224 for the checksums (non standard)"""
     return CompactHash(hashlib.sha224(*args,**kwargs))
 
-def sha512(*args, **kwargs):
-    return CompactHash(hashlib.sha512(*args,**kwargs))
+def sha512(baseStr=None,*args,**kwargs):
+    """Uses sha512 to calculate the gid (default in nomad)
+
+    If you pass and argument it is immediately added to the checksum.
+    Thus sha512("someString").gid("X") creates a gid in one go"""
+    sha=CompactHash(hashlib.sha512(*args,**kwargs))
+    if baseStr is not None:
+        sha.update(baseStr)
+    return sha
 
 def md5(*args, **kwargs):
+    """CompactSha using md5 for the checksums (non standard)"""
     return CompactHash(hashlib.md5(*args,**kwargs))