add random getbyteslength function