Why not have a tokenizer constructor that takes a secret as an argument and then returns an instance with encode and decode. This would allow you to also configure other parameters such as truncation, too.