Lua Script is not compatible with LUA5.4
In https://github.com/google/diff-match-patch/blob/62f2e689f498f9c92dbc588c58750addec9b1654/lua/diff_match_patch.lua#L30-L31 the functions band, bor, and lshift are imported from bit32. The above comment (https://github.com/google/diff-match-patch/blob/62f2e689f498f9c92dbc588c58750addec9b1654/lua/diff_match_patch.lua#L22-L28) says, for Lua 5.1 and earlier one has to install the BitOp Library.
When trying to use this awesome script in Lua5.4 I realized, the bit32 is no longer included (I'm not sure about Lua5.3, but I could not find bit32 in the user manual https://www.lua.org/manual/5.3/manual.html).
I solved the issue by including custom implementations from https://github.com/Egor-Skriptunoff/pure_lua_SHA/blob/master/sha2.lua, but maybe it would be good to include something like this into the script or at least update the comment above to make clear, it is only working with Lua5.2 and not with later versions.
If I can help in any way by contributing a pull request, let me know.
Source: google/diff-match-patch