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

Function writeInt16

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

Source from the content-addressed store, hash-verified

74const textDecoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true })
75
76const writeInt16 = (bytes: Uint8Array, offset: number, value: number): void => {
77 bytes[offset] = value >>> 8
78 bytes[offset + 1] = value
79}
80
81const readInt16 = (bytes: Uint8Array, offset: number): number => ((bytes[offset] << 8) | bytes[offset + 1]) << 16 >> 16
82

Callers 2

encodeNumericFunction · 0.85
numericSpecialFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected