Ah, I see.

The problem with using a fixed-length substring is that the length of the hash can change. Sometimes it's a 32-character hash, sometimes it's a 40-character hash. Someday it might be a 64-character hash (if we move to SHA256).

Suggest that we split the hash on "?" and take the 0th element. This will work under all cases:

  cookbook.hash.split('?').first