Debian Codegraph @

upstream/debian-trixie/man3/crypt_preferred_method.3

raw
1 .\" Written by Björn Esser <besser82 at fedoraproject.org> in 2018.
2 .\"
3 .\" To the extent possible under law, the authors have waived
4 .\" all copyright and related or neighboring rights to this work.
5 .\" See https://creativecommons.org/publicdomain/zero/1.0/ for further
6 .\" details.
7 .\"
8 .Dd November 16, 2018
9 .Dt CRYPT_PREFERRED_METHOD 3
10 .Os "libxcrypt"
11 .Sh NAME
12 .Nm crypt_preferred_method
13 .Nd get the prefix of the preferred hash method
14 .Sh LIBRARY
15 .Lb libcrypt
16 .Sh SYNOPSIS
17 .In crypt.h
18 .Ft const char*
19 .Fo crypt_preferred_method
20 .Fa "void"
21 .Fc
22 .Sh DESCRIPTION
23 .Nm
24 is a convenience function to get the prefix of the preferred hash
25 method. If a preferred method is available, it is the same as the
26 one also used by the
27 .Nm crypt_gensalt functions ,
28 if their given
29 .Ar prefix
30 parameter is NULL.
31 .Sh RETURN VALUES
32 The string returned equals the prefix of the preferred hash method.
33 If no preferred hash method is available it is NULL. It
34 .Em is
35 safe to pass the string returned by
36 .Nm crypt_preferred_method
37 directly to
38 .Nm crypt_gensalt
39 without prior string-sanitizing nor NULL-pointer checks.
40 .Sh FEATURE TEST MACROS
41 .In crypt.h
42 will define the macro
43 .Dv CRYPT_PREFERRED_METHOD_AVAILABLE
44 if
45 .Nm
46 is available in the current version of libxcrypt.
47 .Sh PORTABILITY NOTES
48 The function
49 .Nm
50 is not part of any standard.
51 It was added to libxcrypt in version 4.4.0.
52 .Sh ATTRIBUTES
53 For an explanation of the terms used in this section, see
54 .Xr attributes 7 .
55 .TS
56 allbox;
57 lb lb lb
58 l l l.
59 Interface Attribute Value
60 T{
61 .Nm
62 T} Thread safety MT-Safe
63 .TE
64 .sp
65 .Sh SEE ALSO
66 .Xr crypt_gensalt 3