Skip to content

Commit cf0fa7f

Browse files
committed
doc: document buffer's "Uint" aliases clearly
Fixes: #36751 PR-URL: #36796 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent 5f36ff8 commit cf0fa7f

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
@@ -1416,6 +1416,8 @@ changes:
14161416
Reads an unsigned, big-endian 64-bit integer from `buf` at the specified
14171417
`offset`.
14181418

1419+
This function is also available under the `readBigUint64BE` alias.
1420+
14191421
```js
14201422
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
14211423

@@ -1443,6 +1445,8 @@ changes:
14431445
Reads an unsigned, little-endian 64-bit integer from `buf` at the specified
14441446
`offset`.
14451447

1448+
This function is also available under the `readBigUint64LE` alias.
1449+
14461450
```js
14471451
const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
14481452

@@ -1758,6 +1762,8 @@ changes:
17581762

17591763
Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
17601764

1765+
This function is also available under the `readUint8` alias.
1766+
17611767
```js
17621768
const buf = Buffer.from([1, -2]);
17631769

@@ -1789,6 +1795,8 @@ changes:
17891795
Reads an unsigned, big-endian 16-bit integer from `buf` at the specified
17901796
`offset`.
17911797

1798+
This function is also available under the `readUint16BE` alias.
1799+
17921800
```js
17931801
const buf = Buffer.from([0x12, 0x34, 0x56]);
17941802

@@ -1818,6 +1826,8 @@ changes:
18181826
Reads an unsigned, little-endian 16-bit integer from `buf` at the specified
18191827
`offset`.
18201828

1829+
This function is also available under the `readUint16LE` alias.
1830+
18211831
```js
18221832
const buf = Buffer.from([0x12, 0x34, 0x56]);
18231833

@@ -1849,6 +1859,8 @@ changes:
18491859
Reads an unsigned, big-endian 32-bit integer from `buf` at the specified
18501860
`offset`.
18511861

1862+
This function is also available under the `readUint32BE` alias.
1863+
18521864
```js
18531865
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
18541866

@@ -1876,6 +1888,8 @@ changes:
18761888
Reads an unsigned, little-endian 32-bit integer from `buf` at the specified
18771889
`offset`.
18781890

1891+
This function is also available under the `readUint32LE` alias.
1892+
18791893
```js
18801894
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
18811895

@@ -1908,6 +1922,8 @@ Reads `byteLength` number of bytes from `buf` at the specified `offset`
19081922
and interprets the result as an unsigned big-endian integer supporting
19091923
up to 48 bits of accuracy.
19101924

1925+
This function is also available under the `readUintBE` alias.
1926+
19111927
```js
19121928
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
19131929

@@ -1940,6 +1956,8 @@ Reads `byteLength` number of bytes from `buf` at the specified `offset`
19401956
and interprets the result as an unsigned, little-endian integer supporting
19411957
up to 48 bits of accuracy.
19421958

1959+
This function is also available under the `readUintLE` alias.
1960+
19431961
```js
19441962
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
19451963

@@ -2353,6 +2371,8 @@ changes:
23532371

23542372
Writes `value` to `buf` at the specified `offset` as big-endian.
23552373

2374+
This function is also available under the `writeBigUint64BE` alias.
2375+
23562376
```js
23572377
const buf = Buffer.allocUnsafe(8);
23582378

@@ -2389,6 +2409,8 @@ console.log(buf);
23892409
// Prints: <Buffer de fa ce ca fe fa ca de>
23902410
```
23912411

2412+
This function is also available under the `writeBigUint64LE` alias.
2413+
23922414
### `buf.writeDoubleBE(value[, offset])`
23932415
<!-- YAML
23942416
added: v0.11.15
@@ -2734,6 +2756,8 @@ Writes `value` to `buf` at the specified `offset`. `value` must be a
27342756
valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
27352757
other than an unsigned 8-bit integer.
27362758

2759+
This function is also available under the `writeUint8` alias.
2760+
27372761
```js
27382762
const buf = Buffer.allocUnsafe(4);
27392763

@@ -2768,6 +2792,8 @@ Writes `value` to `buf` at the specified `offset` as big-endian. The `value`
27682792
must be a valid unsigned 16-bit integer. Behavior is undefined when `value`
27692793
is anything other than an unsigned 16-bit integer.
27702794

2795+
This function is also available under the `writeUint16BE` alias.
2796+
27712797
```js
27722798
const buf = Buffer.allocUnsafe(4);
27732799

@@ -2802,6 +2828,8 @@ Writes `value` to `buf` at the specified `offset` as little-endian. The `value`
28022828
must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is
28032829
anything other than an unsigned 16-bit integer.
28042830

2831+
This function is also available under the `writeUint16LE` alias.
2832+
28052833
```js
28062834
const buf = Buffer.allocUnsafe(4);
28072835

@@ -2834,6 +2862,8 @@ Writes `value` to `buf` at the specified `offset` as big-endian. The `value`
28342862
must be a valid unsigned 32-bit integer. Behavior is undefined when `value`
28352863
is anything other than an unsigned 32-bit integer.
28362864

2865+
This function is also available under the `writeUint32BE` alias.
2866+
28372867
```js
28382868
const buf = Buffer.allocUnsafe(4);
28392869

@@ -2865,6 +2895,8 @@ Writes `value` to `buf` at the specified `offset` as little-endian. The `value`
28652895
must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is
28662896
anything other than an unsigned 32-bit integer.
28672897

2898+
This function is also available under the `writeUint32LE` alias.
2899+
28682900
```js
28692901
const buf = Buffer.allocUnsafe(4);
28702902

@@ -2898,6 +2930,8 @@ Writes `byteLength` bytes of `value` to `buf` at the specified `offset`
28982930
as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
28992931
when `value` is anything other than an unsigned integer.
29002932

2933+
This function is also available under the `writeUintBE` alias.
2934+
29012935
```js
29022936
const buf = Buffer.allocUnsafe(6);
29032937

@@ -2931,6 +2965,8 @@ Writes `byteLength` bytes of `value` to `buf` at the specified `offset`
29312965
as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
29322966
when `value` is anything other than an unsigned integer.
29332967

2968+
This function is also available under the `writeUintLE` alias.
2969+
29342970
```js
29352971
const buf = Buffer.allocUnsafe(6);
29362972

0 commit comments

Comments
 (0)