gnutls_hash_copy(3)

✨ gnutls_hash_copy(3) ✨

okay bestie, pull up a chair πŸ’– this one lives in the gnutls manual (the 3.8.13 era, we'll get to that at the end) and it's genuinely so useful. let's go 🫢


πŸŽ€ NAME πŸŽ€

gnutls_hash_copy β€” and it is literally an API function, no cap πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/crypto.h>

gnutls_hash_hd_t gnutls_hash_copy(gnutls_hash_hd_t handle);

like... that's it. one include, one function, one lil handle going in and one lil handle coming out πŸ¦‹


πŸ“ ARGUMENTS πŸ“

  • gnutls_hash_hd_t handle β€” bestie this is a gnutls_hash_hd_t type. that's the whole description. the manpage said what it said and we respect it πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the vibe: this function creates a copy of a Message Digest context, and the copy contains all its current state. like, the whole snapshot. the energy, the progress, everything. icon status ⭐

but β€” and this is the important part, don't skip it β€” copying contexts for Message Digests that were registered using gnutls_crypto_register_digest() is not supported and will always result in an error. periodt. πŸ’€

and on top of that? some of the Message Digest implementations just... don't support this operation either. so it's giving "it depends". 😭

so applications should check the return value and provide a proper fallback. fr fr, do not skip the check. that's not a suggestion, that's the whole assignment. πŸ‘‘

πŸ”₯ RETURNS πŸ”₯

a new Message Digest context ✨ β€” or NULL in case of an error. that's it, that's the return. check it. love it. handle it. πŸ’…


🌈 SINCE 🌈

3.6.9 β€” so it's been around a minute, it's a classic, it ate πŸŽ€


πŸ¦‹ REPORTING BUGS πŸ¦‹

found something cursed? tell the devs, they wanna know:


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.


πŸ’– SEE ALSO πŸ’–

The full documentation for gnutls is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form visit

https://www.gnutls.org/manual/


and that's the whole page, bestie 🧚 mwah πŸ’‹ this was the gnutls manual, version 3.8.13, and gnutls_hash_copy(3) says bye πŸ‘‹πŸ’•

πŸ“¦ where this page comes from