This simple library makes it easier to distinguish between common ways to represent byte sequences. The following approach is used to make a "newtype" for each representation:
https://calebmer.com/tangents/opaque-types-in-typescript.html
https://evertpot.com/opaque-ts-types/
https://kubyshkin.name/posts/newtype-in-typescript/