sheng-tool
    Preparing search index...

    Function isGifBytes

    • 判断字节序列是否以 GIF87a 或 GIF89a 头开头。

      Parameters

      • bytes: ByteSource

        待检查的字节序列,可以是 Uint8Array、Buffer 或普通数字数组。

      Returns boolean

      如果前 6 个字节是 GIF 签名,返回 true。

      0.2.0

      isGifBytes(new Uint8Array([71, 73, 70, 56, 57, 97]))   // true
      isGifBytes(new Uint8Array([137, 80, 78, 71])) // false