* chore: add error codes * chore: create errors with new Error() * fix: better error testin * refactor: simplify random bytes error checks