Skip to content

Commit eee148e

Browse files
committed
exposed make hash to lua
Signed-off-by: nicol-ii <[email protected]>
1 parent 485e175 commit eee148e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/parsec/agent/runners/lua/impl.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,14 @@ namespace cbdc::parsec::agent::runner {
315315
size_t sz{};
316316
const auto* str = lua_tolstring(L, 1, &sz);
317317
assert(str != nullptr);
318-
// compute hash
319318
auto sha = CSHA256();
320319
auto unsigned_str = std::vector<unsigned char>(sz);
321320
std::memcpy(unsigned_str.data(), str, sz);
322321
sha.Write(unsigned_str.data(), sz);
323322
cbdc::hash_t computed_hash{};
324323
sha.Finalize(computed_hash.data());
325324
lua_pushlstring(L, reinterpret_cast<char*>(computed_hash.data()), sz);
326-
return 0;
325+
return 1;
327326
}
328327

329328
}

0 commit comments

Comments
 (0)