Skip to content

Commit 7c7180a

Browse files
targosdanielleadams
authored andcommitted
doc: document buffer's "Uint" aliases clearly
Fixes: #36751 PR-URL: #36796 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Harshitha K P <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent 9d25d25 commit 7c7180a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

doc/api/buffer.md

+36
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,8 @@ changes:
14311431
Reads an unsigned, big-endian 64-bit integer from `buf` at the specified
14321432
`offset`.
14331433

1434+
This function is also available under the `readBigUint64BE` alias.
1435+
14341436
```js
14351437
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
14361438

@@ -1458,6 +1460,8 @@ changes:
14581460
Reads an unsigned, little-endian 64-bit integer from `buf` at the specified
14591461
`offset`.
14601462

1463+
This function is also available under the `readBigUint64LE` alias.
1464+
14611465
```js
14621466
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
14631467

@@ -1775,6 +1779,8 @@ changes:
17751779

17761780
Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
17771781

1782+
This function is also available under the `readUint8` alias.
1783+
17781784
```js
17791785
const buf = Buffer.from([1, -2]);
17801786

@@ -1808,6 +1814,8 @@ changes:
18081814
Reads an unsigned, big-endian 16-bit integer from `buf` at the specified
18091815
`offset`.
18101816

1817+
This function is also available under the `readUint16BE` alias.
1818+
18111819
```js
18121820
const buf = Buffer.from([0x12, 0x34, 0x56]);
18131821

@@ -1839,6 +1847,8 @@ changes:
18391847
Reads an unsigned, little-endian 16-bit integer from `buf` at the specified
18401848
`offset`.
18411849

1850+
This function is also available under the `readUint16LE` alias.
1851+
18421852
```js
18431853
const buf = Buffer.from([0x12, 0x34, 0x56]);
18441854

@@ -1872,6 +1882,8 @@ changes:
18721882
Reads an unsigned, big-endian 32-bit integer from `buf` at the specified
18731883
`offset`.
18741884

1885+
This function is also available under the `readUint32BE` alias.
1886+
18751887
```js
18761888
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
18771889

@@ -1901,6 +1913,8 @@ changes:
19011913
Reads an unsigned, little-endian 32-bit integer from `buf` at the specified
19021914
`offset`.
19031915

1916+
This function is also available under the `readUint32LE` alias.
1917+
19041918
```js
19051919
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
19061920

@@ -1935,6 +1949,8 @@ Reads `byteLength` number of bytes from `buf` at the specified `offset`
19351949
and interprets the result as an unsigned big-endian integer supporting
19361950
up to 48 bits of accuracy.
19371951

1952+
This function is also available under the `readUintBE` alias.
1953+
19381954
```js
19391955
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
19401956

@@ -1969,6 +1985,8 @@ Reads `byteLength` number of bytes from `buf` at the specified `offset`
19691985
and interprets the result as an unsigned, little-endian integer supporting
19701986
up to 48 bits of accuracy.
19711987

1988+
This function is also available under the `readUintLE` alias.
1989+
19721990
```js
19731991
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
19741992

@@ -2384,6 +2402,8 @@ changes:
23842402

23852403
Writes `value` to `buf` at the specified `offset` as big-endian.
23862404

2405+
This function is also available under the `writeBigUint64BE` alias.
2406+
23872407
```js
23882408
const buf = Buffer.allocUnsafe(8);
23892409

@@ -2422,6 +2442,8 @@ console.log(buf);
24222442
// Prints: <Buffer de fa ce ca fe fa ca de>
24232443
```
24242444

2445+
This function is also available under the `writeBigUint64LE` alias.
2446+
24252447
### `buf.writeDoubleBE(value[, offset])`
24262448
<!-- YAML
24272449
added: v0.11.15
@@ -2769,6 +2791,8 @@ Writes `value` to `buf` at the specified `offset`. `value` must be a
27692791
valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
27702792
other than an unsigned 8-bit integer.
27712793

2794+
This function is also available under the `writeUint8` alias.
2795+
27722796
```js
27732797
const buf = Buffer.allocUnsafe(4);
27742798

@@ -2805,6 +2829,8 @@ Writes `value` to `buf` at the specified `offset` as big-endian. The `value`
28052829
must be a valid unsigned 16-bit integer. Behavior is undefined when `value`
28062830
is anything other than an unsigned 16-bit integer.
28072831

2832+
This function is also available under the `writeUint16BE` alias.
2833+
28082834
```js
28092835
const buf = Buffer.allocUnsafe(4);
28102836

@@ -2839,6 +2865,8 @@ Writes `value` to `buf` at the specified `offset` as little-endian. The `value`
28392865
must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is
28402866
anything other than an unsigned 16-bit integer.
28412867

2868+
This function is also available under the `writeUint16LE` alias.
2869+
28422870
```js
28432871
const buf = Buffer.allocUnsafe(4);
28442872

@@ -2873,6 +2901,8 @@ Writes `value` to `buf` at the specified `offset` as big-endian. The `value`
28732901
must be a valid unsigned 32-bit integer. Behavior is undefined when `value`
28742902
is anything other than an unsigned 32-bit integer.
28752903

2904+
This function is also available under the `writeUint32BE` alias.
2905+
28762906
```js
28772907
const buf = Buffer.allocUnsafe(4);
28782908

@@ -2906,6 +2936,8 @@ Writes `value` to `buf` at the specified `offset` as little-endian. The `value`
29062936
must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is
29072937
anything other than an unsigned 32-bit integer.
29082938

2939+
This function is also available under the `writeUint32LE` alias.
2940+
29092941
```js
29102942
const buf = Buffer.allocUnsafe(4);
29112943

@@ -2941,6 +2973,8 @@ Writes `byteLength` bytes of `value` to `buf` at the specified `offset`
29412973
as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
29422974
when `value` is anything other than an unsigned integer.
29432975

2976+
This function is also available under the `writeUintBE` alias.
2977+
29442978
```js
29452979
const buf = Buffer.allocUnsafe(6);
29462980

@@ -2976,6 +3010,8 @@ Writes `byteLength` bytes of `value` to `buf` at the specified `offset`
29763010
as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
29773011
when `value` is anything other than an unsigned integer.
29783012

3013+
This function is also available under the `writeUintLE` alias.
3014+
29793015
```js
29803016
const buf = Buffer.allocUnsafe(6);
29813017

0 commit comments

Comments
 (0)