uint32_t hash_kernel(const kernel_t *kernel)
{
    const size_t n = kernel->size;

    // seed
    uint32_t h = static_cast<uint32_t>(n);

    // TNFA states
    h = hash32(h, kernel->state, n * sizeof(void*));

    // precedence table
    if (kernel->prectbl) {
        h = hash32(h, kernel->prectbl, n * n * sizeof(prectable_t));
    }

    return h;
}
uint32_t hash_kernel(const kernel_t *kernel)
{
    const size_t n = kernel->size;

     
    uint32_t h = static_cast<uint32_t>(n);

     
    h = hash32(h, kernel->state, n * sizeof(void*));

     
    if (kernel->prectbl) {
        h = hash32(h, kernel->prectbl, n * n * sizeof(prectable_t));
    }

    return h;
}