code: func Digest(bundleHash []int8, signatureFragment Trits, startOffset int, spongeFunc ...SpongeFunction) (Trits, error) {
  	sigLength := len(signatureFragment)
  
  	secLvl, err := GetSecurityLevel(bundleHash)
  	if err != nil {
  		return nil, err
  	}
  
  	sigFrag := make(Trits, sigLength)
  	copy(sigFrag, signatureFragment[:sigLength])
  
  	h := GetSpongeFunc(spongeFunc, kerl.NewKerl)
  	defer h.Reset()
  
  	dig := make(Trits, HashTrinarySize)
  	sig := make(Trits, HashTrinarySize)
  
  	i := startOffset % int(secLvl)
  	for digLength := 0; digLength < sigLength; {
  		for j := i * ISSChunkLength; j < (i+1)*ISSChunkLength && digLength < sigLength; j += TrinaryRadix {
  			copy(sig, sigFrag[digLength:digLength+HashTrinarySize])
  
  			to := (bundleHash[j] + bundleHash[j+1]*3 + bundleHash[j+2]*9) - MinTryteValue
  
  			for k := 0; k < int(to); k++ {
  				err := h.Absorb(sig)
  				if err != nil {
  					return nil, err
  				}
  				sig, err = h.Squeeze(HashTrinarySize)
  				if err != nil {
  					return nil, err
  				}
  				h.Reset()
  			}
  
  			copy(sigFrag[digLength:], sig)
  			digLength += HashTrinarySize
  		}
  
  		i = (i + 1) % int(secLvl)
  	}
  
  	err = h.Absorb(sigFrag)
  	if err != nil {
  		return nil, err
  	}
  
  	dig, err = h.Squeeze(HashTrinarySize)
  	if err != nil {
  		return nil, err
  	}
  
  	return dig, nil
  }
docs: // Digest computes the digest derived from the signature fragment and bundle hash.
  // Optionally takes the SpongeFunction to use. Default is Kerl.