MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / read

Function read

g2all/900/module/rw.js:90–97  ·  view source on GitHub ↗
(u8_view, offset, size)

Source from the content-addressed store, hash-verified

88
89// for reads less than 8 bytes
90function read(u8_view, offset, size) {
91 let res = 0;
92 for (let i = 0; i < size; i++) {
93 res += u8_view[offset + i] << i*8;
94 }
95 // << returns a signed integer, >>> converts it to unsigned
96 return res >>> 0;
97}
98
99export function read16(u8_view, offset) {
100 return read(u8_view, offset, 2);

Callers 2

read16Function · 0.70
read32Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected