Ejemplo n.º 1
0
/* [n] -> {0 .., n-1} */
unsigned int rc_h1(int n, int j, unsigned int value) {
  
  assert((j >= 1) && (j <= 3));
  
  return rc_hash(n, j, value);
  
}
Ejemplo n.º 2
0
/* Kre^3 -> {1 ... Kre} */
unsigned int rc_h3(int Kre, int j, unsigned int value) {
  
  assert((j >= 1) && (j <= 3));
  
  return rc_hash(Kre, j, value) + 1;
  
  /* return 1 to Kre */
  return (value % Kre) + 1;
  
}
Ejemplo n.º 3
0
Archivo: t_rcint.c Proyecto: itmm/hash
static void _hash_neg(unit_state *state) {
    rcint *a = rcint_alloc(-42);
    assert_eq(state, -42 & INT_MAX, rc_hash(a));
}
Ejemplo n.º 4
0
Archivo: t_rcint.c Proyecto: itmm/hash
static void _hash_pos(unit_state *state) {
    rcint *a = rcint_alloc(42);
    assert_eq(state, 42, rc_hash(a));
}