Implementations of common encoders and decoders