SNOBOL4DIGEST(3)
π SNOBOL4DIGEST(3) π
okay bestie, welcome to the CSNOBOL4 Manual β this one's all about digest, the message digest library. cryptographic vibes only, no cap. πβ¨
β¨ NAME β¨
digest β message digest library. that's it, that's the whole thing. hashing, but make it SNOBOL4. π¦
πΈ SYNOPSYS πΈ
like, here's the whole shape of it, bestie:
-INCLUDE 'digest.sno'
handle = DIGEST_INIT(algorithm)
DIGEST_UPDATE(handle,string)
bytes = DIGEST_FINAL(handle)
string = DIGEST_HEX(bytes)
bytes = DIGEST(algorithm,string)
(and yes the heading is spelled "SYNOPSYS" in the original, i'm just being faithful, don't come for me π)
π DESCRIPTION π
so the digest module does cryptographic Message Digest calculations. it's giving math but make it mysterious. π
π§ DIGEST_INIT
DIGEST_INIT takes a digest algorithm name β like the ones listed by openssl help β and hands you back an opaque handle to an object. π«Ά
real talk though: not all algorithms are implemented by all versions of the openssl library. so if something's missing, it's not you, it's the library. π
and also, lowkey important:
- Older algorithms have known collision weaknesses. β οΈ
- Newer algorithms (and longer hash outputs) are slower! π
so likeβ¦ pick your fighter, bestie. there's a tradeoff and you have to live with it. π
π¦ DIGEST_UPDATE
DIGEST_UPDATE incorporates the string into the hash. π«§
and here's the iconic part: calling it multiple times should produce the same result as concatenating all the input strings into one single update call. same energy, different number of calls. periodt. β¨
π DIGEST_FINAL
DIGEST_FINAL returns a string of binary bytes with the hash value β and then it deletes the object and handle. so like, that handle is gone gone. don't try to use it again, she's retired. π
π DIGEST_HEX
DIGEST_HEX takes a string of binary bytes and gives you back a string of lower case hex. lowercase!! not shouting, just vibing. π
β DIGEST
DIGEST is the one-call wonder: takes an algorithm name and a string to hash, and returns binary bytes. no handle wrangling, just straight to the point. main character energy. π₯
π one more thing
if you're actually here for CRC32 and ADLER32 hash algorithms, that's a whole different page β go peek at snobol4zlib(3). iykyk. π«
π SEE ALSO π
π AUTHOR π
Phil Budne β king behavior, we stan. π«Ά
okay that's the whole page, bestie!! CSNOBOL4B 2.3.1, dated March 31, 2022 β mwah, go hash something responsibly. π β¨ππ¦
π¦ where this page comes from
- fedora 43: snobol4 2.3.1-7.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- fedora 43: snobol4 2.3.1-7.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- fedora 44: snobol4 2.3.1-8.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- fedora 44: snobol4 2.3.1-8.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- opensuse-leap 16.0: snobol4 2.3.1-160000.2.2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms