See the SPI plugin, or the milinst one for examples. We normally end up with <path>-break for the key for example (generated in a little function).

I wouldn't worry about hashes too much, it doesn't get into the actual file, and we've not bothered elsewhere.