util: extract out encoding validation functions
I saw some duplicate validations within internal/encoding.js
, so I extracted them out to separate functions.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
util