FsPages laisse la place à Gitlab Pages ! Voici la documentation pour vous en servir : https://docs.gitlab.com/ce/user/project/pages/index.html

Public
Snippet $353 authored by lpoujade

mini hash table for term capabilities

hash_term_capabilities.c
#include "libft.h"

unsigned int	chash(char *word, int max_hash)
{
	int				c;
	unsigned int	hash;

	hash = 0;
	c = 0;
	while (word[c])
	{
		hash = word[c] + (hash << 6) + (hash << 16) - hash;
		c++;
	}
	hash %= max_hash;
	return (hash);
}

int main(void)
{
	int i =0;
	char *cap[] = {"do", "le", "sc", "rc", "ic", "vi", "iv", "vb", "cr", "dc", "nd", "im", "ei", "cd", "DO", "RI", NULL};


	while (cap[i])
	{
		ft_putstr(cap[i]); ft_putstr("\t=>\t"); ft_putnbr(chash(cap[i], 127));
		ft_putchar('\n');
		i++;
	}
	return (0);

}