MCPcopy Create free account
hub / github.com/Effect-TS/effect / writeInt32

Function writeInt32

packages/sql/pg/src/PgTypes.ts:85–90  ·  view source on GitHub ↗
(bytes: Uint8Array, offset: number, value: number)

Source from the content-addressed store, hash-verified

83const readUint16 = (bytes: Uint8Array, offset: number): number => (bytes[offset] << 8) | bytes[offset + 1]
84
85const writeInt32 = (bytes: Uint8Array, offset: number, value: number): void => {
86 bytes[offset] = value >>> 24
87 bytes[offset + 1] = value >>> 16
88 bytes[offset + 2] = value >>> 8
89 bytes[offset + 3] = value
90}
91
92const readInt32 = (bytes: Uint8Array, offset: number): number =>
93 (bytes[offset] << 24) | (bytes[offset + 1] << 16) | (bytes[offset + 2] << 8) | bytes[offset + 3]

Callers 6

writeInt64Function · 0.85
encodeUuidFunction · 0.85
PgTypes.tsFile · 0.85
encodeArrayFunction · 0.85
framedFunction · 0.85
encodeMultirangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected