encoding: Implement encodeKeyLocator.