const gifSignature = [0x47, 0x49, 0x46, 0x38];

export async function isImageBlobAGifFile(blob: Blob) {
  const arrayBuffer = await blob.arrayBuffer();
  const uint8Array = new Uint8Array(arrayBuffer);

  if (
    uint8Array[0] === gifSignature[0] &&
    uint8Array[1] === gifSignature[1] &&
    uint8Array[2] === gifSignature[2] &&
    uint8Array[3] === gifSignature[3]
  )
    return true;

  return false;
}
