luajitos

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

Hash_Lua.h (1016B)


      1 /*
      2  * Hash_Lua.h - Lua bindings for hash functions
      3  */
      4 
      5 #ifndef HASH_LUA_H
      6 #define HASH_LUA_H
      7 
      8 #include <lua.h>
      9 #include <lauxlib.h>
     10 #include <stdint.h>
     11 #include <stddef.h>
     12 
     13 /* Base64 encoding function (provided by crypto.c) */
     14 char* base64_encode(const uint8_t *data, size_t len, size_t *out_len);
     15 
     16 /* Hash function bindings */
     17 int l_hash(lua_State *L);              /* SHA-256 hash returning base64 */
     18 int l_hash_call(lua_State *L);         /* __call metamethod: SHA3-256 (default) */
     19 int l_hash_sha512(lua_State *L);       /* SHA-512 hash */
     20 int l_hash_sha1(lua_State *L);         /* SHA-1 hash (legacy) */
     21 int l_hash_md5(lua_State *L);          /* MD5 hash (binary or base64 input) */
     22 int l_hash_crc32(lua_State *L);        /* CRC32 checksum */
     23 int l_hash_sha3(lua_State *L);         /* SHA3-256 hash */
     24 int l_hash_sha3_512(lua_State *L);     /* SHA3-512 hash */
     25 int l_hash_blake2b(lua_State *L);      /* BLAKE2b-256 hash */
     26 int l_hash_blake2b_512(lua_State *L);  /* BLAKE2b-512 hash */
     27 
     28 #endif /* HASH_LUA_H */