function repeat(origin, count) {
  if (count === 0) {
    return new Uint8Array();
  }
  if (count < 0) {
    throw new Error("bytes: negative repeat count");
  } else if (origin.length * count / count !== origin.length) {
    throw new Error("bytes: repeat count causes overflow");
  }
  const int = Math.floor(count);
  if (int !== count) {
    throw new Error("bytes: repeat count must be an integer");
  }
  const nb = new Uint8Array(origin.length * count);
  let bp = copyBytes(origin, nb);
  for (; bp < nb.length; bp *= 2) {
    copyBytes(nb.slice(0, bp), nb, bp);
  }
  return nb;
}
/** Repeat bytes. returns a new byte slice consisting of `count` copies of `b`.
 * @param origin The origin bytes
 * @param count The count you want to repeat.
 */
Repeat bytes. returns a new byte slice consisting of `count` copies of `b`.
@param origin The origin bytes
@param count The count you want to repeat.
Repeat bytes . returns a new byte slice consisting of ` count ` copies of ` b ` . @param origin The origin bytes @param count The count you want to repeat .
function repeat(origin, count) {
  if (count === 0) {
    return new Uint8Array();
  }
  if (count < 0) {
    throw new Error("bytes: negative repeat count");
  } else if (origin.length * count / count !== origin.length) {
    throw new Error("bytes: repeat count causes overflow");
  }
  const int = Math.floor(count);
  if (int !== count) {
    throw new Error("bytes: repeat count must be an integer");
  }
  const nb = new Uint8Array(origin.length * count);
  let bp = copyBytes(origin, nb);
  for (; bp < nb.length; bp *= 2) {
    copyBytes(nb.slice(0, bp), nb, bp);
  }
  return nb;
}
function repeat ( origin , count ) { if ( count === 0 ) { return new Uint8Array ( ) ; } if ( count < 0 ) { throw new Error ( "bytes: negative repeat count" ) ; } else if ( origin . length * count / count !== origin . length ) { throw new Error ( "bytes: repeat count causes overflow" ) ; } const int = Math . floor ( count ) ; if ( int !== count ) { throw new Error ( "bytes: repeat count must be an integer" ) ; } const nb = new Uint8Array ( origin . length * count ) ; let bp = copyBytes ( origin , nb ) ; for ( ; bp < nb . length ; bp *= 2 ) { copyBytes ( nb . slice ( 0 , bp ) , nb , bp ) ; } return nb ; }
Repeat bytes.
Repeat bytes .