pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:748:
/* The following are internal and shouldn't be applicable in normal use. */ case T_SVALUE_PTR: push_static_text("svalue_ptr"); break; case T_OBJ_INDEX: push_static_text("obj_index"); break; case T_MAPPING_DATA: push_static_text("mapping_data"); break; case T_PIKE_FRAME: push_static_text("pike_frame"); break; case T_MULTISET_DATA: push_static_text("multiset_data"); break; default: push_static_text("unknown"); break; } }
+
/*! @decl siphash24(string data, void|int key)
+
*! @appears Crypto.siphash24
+
*!
+
*! Hashes a string, with an optional key, to a 64 bit integer using
+
*! the siphash-2-4 algorithm. Currently the 64 bit @[key] parameter
+
*! is used both for the high and low part of the 128 bit key.
+
*!
+
*/
+
#include "siphash24.h"
+
PIKEFUN int siphash24(string s, void|int key)
+
{
+
mpz_t ret;
+
mpz_init(ret);
+
mpz_set_ui(ret, pike_string_siphash24(s, key && key->u.integer) );
+
push_bignum(ret);
+
}
/*! @decl string int2char(int x) *! @appears String.int2char *! *! Same as sprintf("%c",x); *! *! @seealso *! @[sprintf()] */ PMOD_EXPORT