mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 14:59:05 +00:00
test(python): share signed 64-bit marshal constants (#16945)
This commit is contained in:
1 parent
6815eb481f
commit
a0c836d619
3 files changed
+11
-17
No files matched your search
@@ -37,6 +37,13 @@ export const pythonPycHeader = (
|
||||
return header;
|
||||
};
|
||||
|
||||
export const signedInt64Constants = (): Buffer[] =>
|
||||
[42n, -1n, -(1n << 63n), (1n << 63n) - 1n].map((value) => {
|
||||
const payload = Buffer.alloc(8);
|
||||
payload.writeBigInt64LE(value);
|
||||
return Buffer.concat([Buffer.from([0x49]), payload]);
|
||||
});
|
||||
|
||||
const marshalNone = (): Buffer => u8(0x4e);
|
||||
const marshalBytes = (value: Buffer, flagged = false): Buffer =>
|
||||
concat(u8(0x73 | (flagged ? FLAG_REF : 0)), u32(value.length), value);
|
||||
|
||||
Reference in new issue
Block a user