From 729f5403a1605d2acb03fedc8581740e71719047 Mon Sep 17 00:00:00 2001 From: rimuy <46044567+rimuy@users.noreply.github.com> Date: Wed, 7 Aug 2024 20:11:19 -0300 Subject: [PATCH] Add `bit32.byteswap` (#1267) https://luau-lang.org/library#bit32-library (doesn't have a creator-docs description) --- include/lua.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/lua.d.ts b/include/lua.d.ts index bb3a631a5..fcceb026a 100644 --- a/include/lua.d.ts +++ b/include/lua.d.ts @@ -602,6 +602,9 @@ declare namespace bit32 { /** Returns the number of consecutive zero bits in the 32-bit representation of the provided number starting from the right-most (least significant) bit. */ function countrz(n: number): number; + /** Returns `n` with the order of the bytes swapped. */ + function byteswap(n: number): number; + /** * Returns the unsigned number formed by the bits `field` to `field + width - 1` from `n`. * Bits are numbered from 0 (least significant) to 31 (most significant).