logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

crypt_preferred_method — get the prefix of the preferred hash method

Attributes

For an explanation of the terms used in this section, see attributes(7). ┌────────────────────────┬───────────────┬─────────┐ │ InterfaceAttributeValue │ ├────────────────────────┼───────────────┼─────────┤ │ crypt_preferred_method │ Thread safety │ MT-Safe │ └────────────────────────┴───────────────┴─────────┘

Description

crypt_preferred_method is a convenience function to get the prefix of the preferred hash method. If a preferred method is available, it is the same as the one also used by the crypt_gensaltfunctions, if their given prefix parameter is NULL.

Feature Test Macros

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

Library

Crypt Library (libcrypt, -lcrypt)

Name

crypt_preferred_method — get the prefix of the preferred hash method

Portability Notes

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

Return Values

The string returned equals the prefix of the preferred hash method. If no preferred hash method is available it is NULL. It is safe to pass the string returned by crypt_preferred_method directly to crypt_gensalt without prior string-sanitizing nor NULL-pointer checks.

See Also

crypt_gensalt(3) libxcrypt November 16, 2018 CRYPT_PREFERRED_METHOD(3)

Synopsis

#include<crypt.h>constchar*crypt_preferred_method(void);

See Also