mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-02 12:01:53 +08:00
Chore: dedupe and sort other rulesets
This commit is contained in:
9
Build/lib/bitwise.ts
Normal file
9
Build/lib/bitwise.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/** Packs two 16-bit integers into one 32-bit integer */
|
||||
export const pack = (a: number, b: number): number => {
|
||||
return (a << 16) | b;
|
||||
};
|
||||
|
||||
/** Unpacks two 16-bit integers from one 32-bit integer */
|
||||
export const unpack = (value: number): [a: number, b: number] => {
|
||||
return [(value >> 16) & 0xFFFF, value & 0xFFFF];
|
||||
};
|
||||
Reference in New Issue
Block a user