diff options
| author | ame <[email protected]> | 2024-04-05 22:15:55 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-04-05 22:15:55 -0500 |
| commit | 6dbb6dc2104237299cca414cd3a86256122e4abf (patch) | |
| tree | b91c803a9a3ed3b391166684f0ac940c44977f17 /src/hash/crc.c | |
| parent | f752ddb0353fb7b06bce742b64b6a72322b51827 (diff) | |
+ + final fixes
Diffstat (limited to 'src/hash/crc.c')
| -rw-r--r-- | src/hash/crc.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/hash/crc.c b/src/hash/crc.c index 71047cc..f52e005 100644 --- a/src/hash/crc.c +++ b/src/hash/crc.c @@ -87,10 +87,7 @@ common_hash_init_update(crc16); common_hash_init_update(crc8); int l_crc8_final(lua_State* L){ - lua_pushstring(L, "ud"); - lua_gettable(L, 1); - - struct crc8_hash* a = (struct crc8_hash*)lua_touserdata(L, -1); + struct crc8_hash* a = (struct crc8_hash*)lua_touserdata(L, 1); uint32_t u = crc8_final(a); char digest[8]; sprintf(digest,"%x",u); @@ -99,10 +96,7 @@ int l_crc8_final(lua_State* L){ } int l_crc16_final(lua_State* L){ - lua_pushstring(L, "ud"); - lua_gettable(L, 1); - - struct crc16_hash* a = (struct crc16_hash*)lua_touserdata(L, -1); + struct crc16_hash* a = (struct crc16_hash*)lua_touserdata(L, 1); uint32_t u = crc16_final(a); char digest[16]; sprintf(digest,"%04x",u); @@ -111,10 +105,7 @@ int l_crc16_final(lua_State* L){ } int l_crc32_final(lua_State* L){ - lua_pushstring(L, "ud"); - lua_gettable(L, 1); - - struct crc32_hash* a = (struct crc32_hash*)lua_touserdata(L, -1); + struct crc32_hash* a = (struct crc32_hash*)lua_touserdata(L, 1); uint32_t u = crc32_final(a); char digest[32]; sprintf(digest,"%08x",u); |
