Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextToken持久化方案 #21

Open
wangtantan-zz opened this issue Dec 21, 2018 · 1 comment
Open

nextToken持久化方案 #21

wangtantan-zz opened this issue Dec 21, 2018 · 1 comment

Comments

@wangtantan-zz
Copy link
Contributor

wangtantan-zz commented Dec 21, 2018

4.1.0版本中:
nextToken字段为较长byteBuffer中的一小段,如果需要持久化这一token,可以通过如下方式提取出有效段并转换成base64
var nextToken = data.nextToken.toString("base64", data.nextToken.offset, data.nextToken.limit);
回传时,再重新new成buffer
var token = new Buffer(nextToken, "base64");

@IndraNyo
Copy link

但是这个方法我并没有成功
我打印了 data.nextToken.limit 是 undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants