Skip to content

从试用到放弃 #4

Description

@MissWho

1,readme代码跑不起来
UInt8Array实际为Uint8Array,小写i
返回的buffer实际struct.decode无法读取,需要传递buffer.buffer
`
import { qs } from "quick-struct";

const struct = qsstruct { u8 a; };

// Create a UInt8 array
const buffer = new UInt8Array([12]);

// Decode buffer
const result = struct.decode(buffer).toJson();

// Print decoded result
console.log(result.a);
`

2,十六进制FF06在i16和u16类型下输出均为1791,实际i16应为-250,无法转换为无符号i16
3,压缩过的核心代码?开源项目?基于2问题想动手修改核心代码来解决问题,结果发现build/index.js是压缩过的,算了,还是自己用DataView包装一下慢慢改吧。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions