Think it's easier than go through the key string from beginning to the end.