OPENSSL_STRCASECMP(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… OPENSSL_STRCASECMP πŸ’…

okay bestie, welcome to the 3ossl manual page for two lil functions that compare strings while completely ignoring the drama of uppercase vs lowercase. it's giving "we don't care about your shift key" energy and honestly? iconic. ✨


🌸 NAME 🌸

OPENSSL_strcasecmp, OPENSSL_strncasecmp β€” compare two strings ignoring case πŸ”₯

πŸŽ€ SYNOPSIS πŸŽ€

#include <openssl/crypto.h>

int OPENSSL_strcasecmp(const char *s1, const char *s2);
int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n);

πŸ¦‹ DESCRIPTION πŸ¦‹

so OPENSSL_strcasecmp does a byte-by-byte comparison of the strings s1 and s2, and the whole time it is ignoring the case of the characters. like, it literally does not care. not one bit. πŸ’…

OPENSSL_strncasecmp is the same vibe, except it compares no more than n bytes of s1 and s2. that's the only difference, periodt. 🫢

now the locale tea β˜•: on a POSIX-compatible system and on Windows, these functions use the "C" locale for case insensitivity. otherwise, the comparison happens in the current locale. iykyk.

⭐ RETURN VALUES ⭐

both functions return an integer that is less than, equal to, or greater than zero, depending on whether s1 is found to be, respectively, less than, a match for, or greater than s2. that's the whole check-in, bestie. 🌈

πŸ‘‘ NOTES πŸ‘‘

OpenSSL uses case insensitive comparison of ASCII strings a lot β€” like, extensively. and here's the thing: even though OpenSSL itself is locale-agnostic, apps that use the OpenSSL libraries can unpredictably suffer when they mess with localization. the classic example? the Turkish locale, which is well-known for its specific I/i cases (yes, that's a real problem, no cap 😭).

these functions use the C locale for string comparison. so like, no surprises, no locale chaos. we stay unbothered. 🧚

πŸ’œ HISTORY πŸ’œ

these functions were added in OpenSSL 3.0.3. vintage-ish. πŸŽ€

Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


lowkey reminder bestie: the license stuff is fr fr important, don't skip it just because it's at the bottom 🫢

and that's the whole page!! mwah πŸ’‹ β€” this was OPENSSL_STRCASECMP(3ossl), version 3.5.0, dated 2026-09-25. slay, go compare some strings. πŸŒŸπŸ’…

πŸ“¦ where this page comes from