如何通过字节号在node.js中创建位掩码?

发布于 2025-01-26 12:12:12 字数 522 浏览 4 评论 0原文

我有一个字符串:0x55739DC6385D81C53D462A255A17C6BD9A71AA68

而且我还有一个需要实现的函数:

const caller = '0x55739dC6385d81c53d462a255a17C6bd9A71Aa68';
const from = 160;
const to = 96;

const getCallerMask = (from, to, caller) => {
    // need to get mask by from, to on the "caller" string and move bytes to the right by "to" argument
}

这​​是该函数应该做的:

Mask(160, 96, caller) >> 96

我什至不知道上面的哪种语言,但我想它应该从字符串中拿起字节蒙版并移动指针到右侧的96个字节。有没有办法在node.js中实现它?

I have a string: 0x55739dC6385d81c53d462a255a17C6bd9A71Aa68.

And also I have a function that I need to implement:

const caller = '0x55739dC6385d81c53d462a255a17C6bd9A71Aa68';
const from = 160;
const to = 96;

const getCallerMask = (from, to, caller) => {
    // need to get mask by from, to on the "caller" string and move bytes to the right by "to" argument
}

This is what the function should do:

Mask(160, 96, caller) >> 96

I don't even know in which language the example above, but I guess that it should take the byte mask from the string and move the pointer to 96 bytes to the right. Is there a way to implement it in node.js?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文