Bienvenue sur le site de la LibLapin.
Jetez un coup d'oeil en bas de la page pour choisir votre niveau de documentation en fonction de votre niveau avec la LibLapin.
Pour l'instant, c'est réglé sur 'Manuel complet'. Si c'est votre première fois avec la LibLapin, il vaudrait mieux choisir 'Débutant'.
De même, n'oubliez pas de préciser une version de la bibliothèque.

LibLapin's logo

LibLapin

Hash





This module bring weak hashes to Bunny Library. It can be used to generate digest of short length for any other need than security.

The hash module header is lapin/hash.h.
typedef enum e_bunny_rgb
{
     BH_MULTIPLIER,
     BH_FNV,
     BH_FNV_A,
     BH_DJB2,
     BH_SDBM,
     BH_LOSELOSE,
     BH_CUSTOM

} t‌_‌b‌u‌n‌n‌y‌_‌r‌g‌b;

Description

     This is the list of supported hash. H_CUSTOM or any greater value will trigger in b‌u‌n‌n‌y‌_‌h‌a‌s‌h functions calls to customable function pointers.

Some notes about specific symbols

  • BH_MULTIPLIER:
         This algorithm is efficient with strings.
  • BH_DJB2:
         Seems quite efficient in terms of collision.
  • BH_LOSELOSE:
         Checksum.
  • BH_CUSTOM:
         Hashing with this algorithm of any higher value trigger the call to g‌l‌_‌b‌u‌n‌n‌y‌_‌m‌y‌_‌h‌a‌s‌h.



INDEX


Description

     Generate a digest with the sent hash algorithm of data which is of size length bytes.

Parameters


Return value

Return the hash digest of the sent data.




INDEX

k

Description

     This function pointer type is used to define the g‌l‌_‌b‌u‌n‌n‌y‌_‌m‌y‌_‌h‌a‌s‌h function pointer which is used by b‌u‌n‌n‌y‌_‌h‌a‌s‌h when BH_CUSTOM is sent as hash algorithm.

Parameters


Return value

Return the digest of data of size length with your custom algorithm.




INDEX


Description

     This function pointer type is used when BH_CUSTOM is sent as hash algorithm to b‌u‌n‌n‌y‌_‌h‌a‌s‌h.



INDEX

Not implemented void b‌u‌n‌n‌y‌_‌w‌i‌d‌e‌_‌h‌a‌s‌h( t‌_‌b‌u‌n‌n‌y‌_‌h‌a‌s‌h hash, const void *data, size_t length, void *target, size_t target_length );

Description

     Generate a digest with the sent hash algorithm of data which is of size length bytes and store it inside target. The size of the hash will be target_length bytes.

Parameters




INDEX