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

Function read

g2all/700/module/rw.js:95–102  ·  view source on GitHub ↗
(u8_view, offset, size)

Source from the content-addressed store, hash-verified

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

Callers 2

read16Function · 0.70
read32Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected