# 动态二维码

动态二维码主要解决日常开发中单张图片二维码数据量太大，无法扫描问题。

TokenPocket动态二维码协议如下:

```

tp:multiFragment-version=1.0&protocol=TokenPocket&data={
	"content": "0000000000004454F5300000000008_32342342", //分片内容
	"index": "5/7" //5代表当前片的索引，7是整个二维码内容分片数目
}

tp:multiFragment //协议头
version //版本号
protocol //标识TokenPocket协议
content //下划线前面:分片内容， 下划线后面：整个数据块计算出的crc32。如果两个分片的crc32一样，我们可以认为他们是同一份数据的两片分片
index //分片索引(从0开始计算)和分片总数

```

### 如何使用

现在我们有一份数据aaaaabbbbbbbbbbbccccccccccccddddddddddddddeeeeeeeeeeeeeee,需要用动态二维码展示

* 将数据分成2片，aaaaabbbbbbbbbbbcccccccccccc和ddddddddddddddeeeeeeeeeeeeeee
* 产生片数据 &#x20;

```

tp:multiFragment-version=1.0&protocol=TokenPocket&data=
    { 
        "content": "aaaaabbbbbbbbbbbcccccccccccc_3207688794",
        "index": "0/2"
    }
tp:multiFragment-version=1.0&protocol=TokenPocket&data=
    { 
        "content": "aaaaabbbbbbbbbbbcccccccccccc_3207688794",
        "index": "1/2"
    } 
    
```

* 将每一片数据生成图片，组合生成gif或者视频文件

### 参考文档

> <https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.tokenpocket.pro/developer-cn/scan-protocol/dynamic_qrcode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
