1CRYPT_PREFERRED_METHO... BSD Library Functions Manual CRYPT_PREFERRED_METHO...
2

NAME

4     crypt_preferred_method — get the prefix of the preferred hash method
5

LIBRARY

7     Crypt Library (libcrypt, -lcrypt)
8

SYNOPSIS

10     #include <crypt.h>
11
12     const char*
13     crypt_preferred_method(void);
14

DESCRIPTION

16     crypt_preferred_method is a convenience function to get the prefix of the
17     preferred hash method.  If a preferred method is available, it is the
18     same as the one also used by the crypt_gensalt functions, if their given
19     prefix parameter is NULL.
20

RETURN VALUES

22     The string returned equals the prefix of the preferred hash method.  If
23     no preferred hash method is available it is NULL.  It is safe to pass the
24     string returned by crypt_preferred_method directly to crypt_gensalt with‐
25     out prior string-sanitizing nor NULL-pointer checks.
26

FEATURE TEST MACROS

28     <crypt.h> will define the macro CRYPT_PREFERRED_METHOD_AVAILABLE if
29     crypt_preferred_method is available in the current version of libxcrypt.
30

PORTABILITY NOTES

32     The function crypt_preferred_method is not part of any standard.  It was
33     added to libxcrypt in version 4.4.0.
34

ATTRIBUTES

36     For an explanation of the terms used in this section, see attributes(7).
37     ┌───────────────────────┬───────────────┬─────────┐
38Interface              Attribute     Value   
39     ├───────────────────────┼───────────────┼─────────┤
40crypt_preferred_method │ Thread safety │ MT-Safe │
41     └───────────────────────┴───────────────┴─────────┘
42

SEE ALSO

44     crypt_gensalt(3)
45
46libxcrypt                      November 16, 2018                     libxcrypt
Impressum