def bubblebabble(digest):
    """compute bubblebabble representation of digest.
    
    @param digest: raw string representation of digest (e.g. what md5.digest returns)
    @type digest: str

    @return: bubblebabble representation of digest
    @rtype: str
    """
    
    
    
    digest = [ord(x) for x in digest]
    
    dlen = len(digest)
    seed = 1
    rounds = 1+dlen/2
    retval = "x"
    for i in range(rounds):
	if i+1<rounds or dlen % 2:
	    idx0 = (((digest[2*i] >> 6) & 3) + seed) % 6
	    idx1 = (digest[2*i] >> 2) & 15;
            idx2 = ((digest[2*i] & 3) + seed / 6) % 6;
            retval += "%s%s%s" % (vowels[idx0], consonants[idx1], vowels[idx2])
	    if i+1 < rounds:
                idx3 = (digest[2 * i + 1] >> 4) & 15;
                idx4 = digest[2 * i + 1] & 15;
                retval += "%s-%s" % (consonants[idx3], consonants[idx4])
                seed = (seed * 5 + digest[2*i] * 7 +
                        digest[2*i+1]) % 36;
	else:
            idx0 = seed % 6;
            idx1 = 16;
            idx2 = seed / 6;
            retval += "%s%s%s" % (vowels[idx0], consonants[idx1], vowels[idx2])

    retval += "x"
    return retval
compute bubblebabble representation of digest.
    
    @param digest: raw string representation of digest (e.g. what md5.digest returns)
    @type digest: str

    @return: bubblebabble representation of digest
    @rtype: str
    
recipes/Python/299133_bubblebabble/recipe-299133.py