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

how to get bitmap #80

Open
lichcc opened this issue Jun 15, 2021 · 1 comment
Open

how to get bitmap #80

lichcc opened this issue Jun 15, 2021 · 1 comment

Comments

@lichcc
Copy link

lichcc commented Jun 15, 2021

使用redis做签到数据
/*
*redis
*setbit a 11 1
*使用下面的方法直接get key
*控制台返回 'value:: '
*直接返回数据,swagger里面显示返回的是一个特殊字符
*请教一下如何获取二进制的bitmap数据,不然获取签到数据要循环很多次肯定是不科学的
*/
public async getBitValue(key: string): Promise {
if (!this.client) {
await this.getClient();
}
const data = await this.client.get(key);
if (data) {
console.log('value:: ' + data);
return data;
} else {
return null;
}
}

@lichcc lichcc closed this as completed Jun 15, 2021
@lichcc lichcc reopened this Jun 15, 2021
@lichcc
Copy link
Author

lichcc commented Jun 17, 2021

后来使用getbuffer 得到{"type":"Buffer","data":[0,16]}
这个如何转成二进制文本,头大

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

1 participant