crypt.c 496 B

1234567891011121314
  1. #include <unistd.h>
  2. #include <crypt.h>
  3. char *crypt(const char *key, const char *salt)
  4. {
  5. /* This buffer is sufficiently large for all
  6. * currently-supported hash types. It needs to be updated if
  7. * longer hashes are added. The cast to struct crypt_data * is
  8. * purely to meet the public API requirements of the crypt_r
  9. * function; the implementation of crypt_r uses the object
  10. * purely as a char buffer. */
  11. static char buf[128];
  12. return __crypt_r(key, salt, (struct crypt_data *)buf);
  13. }