combine duplicate code from true/false branches
hex constants are uppercase, please
refactor to allow future merging of identical code blocks
improve tests
add a long-string test case to fill out test coverage
the ppp rfc doesn't quite match up with the original paper