get hex representation of a hash value as a string * Returns a hexadecimal representation of a hash value. * The returned string is always padded with leading zeros. * * @name hash_to_hex * @param h [type:hash] hash value to get hex string for * @return hex [type:string] hex representation of the hash * @examples * * ```lua * local h = hash("my_has
| 119 | * ``` |
| 120 | */ |
| 121 | static int HashToHex(lua_State* L) |
| 122 | { |
| 123 | int top = lua_gettop(L); |
| 124 | |
| 125 | dmhash_t hash = dmScript::CheckHash(L, 1); |
| 126 | char buf[17]; |
| 127 | dmSnPrintf(buf, sizeof(buf), "%016llx", (unsigned long long)hash); |
| 128 | lua_pushstring(L, buf); |
| 129 | |
| 130 | assert(top + 1 == lua_gettop(L)); |
| 131 | return 1; |
| 132 | } |
| 133 | |
| 134 | static int HashMD5(lua_State* L) |
| 135 | { |
nothing calls this directly
no test coverage detected