ripemd-128(3trf)

πŸ’– ripemd-128 β€” the manual, but make it cute ✨

okay bestie, gather round, because we're doing ripemd-128(3trf) today and honestly? she's a whole vibe. 🌸


✨ NAME ✨

ripemd-128 β€” Message digest "ripemd-128" πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

package require Tcl  ?8.2?

package require Trf  ?2.1.3?

ripemd-128 ?options...? ?data?

πŸ¦‹ DESCRIPTION πŸ¦‹

so. the command ripemd-128 is one of several message digests that the package trf brings to the party. if you wanna see the whole squad, go read trf-intro β€” it's the overview of the entire package. 🌈

ripemd-128 ?options...? ?data?

okay so here's the tea: the options below are understood by the digest if and only if the digest is attached to a channel. (that's the whole "attached" thing β€” there's a section about it below called IMMEDIATE versus ATTACHED, go peek. πŸ‘€)

  • -mode absorb|write|transparent β€” this option is not optional, bestie. it has to be present. the argument you give it decides how the digest behaves when it's in attached mode. 🫢

and beyond the values listed above, all unique abbreviations are recognized too. here's what they all mean:

  • absorb β€” all data written to the channel is used to calculate the value of the message digest, and then it's passed unchanged to the next level in the stack of transformations for the channel the digest is attached to. when the channel is closed, the completed digest is written out too β€” so basically you're attaching the value of the digest after the information actually written to the channel. πŸ’«

when you're reading from the channel, a value for the digest is computed too, and after the channel closes it's compared to the digest which was attached, i.e. the one that came behind the actual data. the option -matchflag has to be specified so the digest knows where to store the result of said comparison. that result is a string, and it's either "ok" or "failed". 😌

  • write β€” all data read from or written to the channel the digest is attached to is ignored and thrown away. only a value for the digest of the data is computed. when the channel is closed, the computed values are stored as ordered through the options -write-destination, -write-type, -read-destination, and -read-type. πŸ—‘οΈβœ¨
  • transparent β€” this mode is a mixture of both absorb and write modes. like absorb, all data, read or written, passes through the digest unchanged. but the generated values for the digest are handled the same way as for write. 🧚
  • -matchflag varname β€” this option can be used if and only if the option "-mode absorb" is present. in that situation the argument is the name of a global or namespaced variable, and the digest will write the result of comparing two digest values into that variable. the option gets ignored if the channel is write-only, because in that case there's not gonna be any comparison of digest values. no comparison, no result, no varname, periodt. πŸ’…
  • -write-type variable|channel β€” this one's for digests in mode write or transparent. beyond the values listed above, all their unique abbreviations are also allowed as argument values. the option determines the type of the argument to option -write-destination. it defaults to variable. πŸŽ€
  • -read-type variable|channel β€” like option -write-type, but for option -read-destination. twin behavior, no cap. πŸ‘―
  • -write-destination data β€” this one's for digests in mode write or transparent. the value data is either the name of a global (or namespaced) variable or the handle of a writable channel, depending on the value of option -write-type. the message digest computed for data written to the attached channel is written into it after the attached channel was closed. the option is ignored if the channel is read-only. πŸ™ˆ
heads up: using a variable may yield incorrect results under tcl 7.6, because of embedded \0's. 😭
  • -read-destination data β€” this one's also for digests in mode write or transparent. the value data is either the name of a global (or namespaced) variable or the handle of a writable channel, depending on the value of option -read-type. the message digest computed for data read from the attached channel is written into it after the attached channel was closed. the option is ignored if the channel is write-only. πŸ™ˆ
same warning bestie: using a variable may yield incorrect results under tcl 7.6, due to embedded \0's. 😭

okay, the options listed below are always understood by the digest β€” attached versus immediate doesn't matter at all. (again, see the IMMEDIATE versus ATTACHED section for what those two words even mean. πŸ’–)

  • -attach channel β€” the presence or absence of this option determines the main operation mode of the transformation. πŸ‘‘

if it's present, the transformation gets stacked onto the channel whose handle you gave to the option, and it runs in attached mode. more about that in the IMMEDIATE versus ATTACHED section.

if it's absent, the transformation is used in immediate mode and the options listed below are recognized. more about that in the IMMEDIATE versus ATTACHED section too. πŸ¦‹

  • -in channel β€” this option is legal if and only if the transformation is used in immediate mode. it provides the handle of the channel the data to transform has to be read from. πŸ“₯

if the transformation is in immediate mode and this option is absent, the data to transform is expected as the last argument to the transformation.

  • -out channel β€” this option is legal if and only if the transformation is used in immediate mode. it provides the handle of the channel the generated transformation result is written to. πŸ“€

if the transformation is in immediate mode and this option is absent, the generated data is returned as the result of the command itself.


πŸ“ NOTES πŸ“

for additional information, go look at http://www.esat.kuleuven.ac.be/%7Ebosselae/ripemd160.html β€” she's got the lore. πŸ’œ


πŸ’« IMMEDIATE VERSUS ATTACHED πŸ’«

the transformation distinguishes between two main ways of using it: the immediate and attached operation modes. two modes, two moods. ✨

for the attached mode, the option -attach is used to associate the transformation with an existing channel. during the execution of the command, no transformation is performed β€” instead the channel itself gets changed in such a way that from then on, all data written to or read from it passes through the transformation and is modified by it according to the definition above. this attachment can be revoked by executing the command unstack for the chosen channel. that is the only way to do this at the Tcl level. 😀

in the second mode β€” which you can detect by the absence of option -attach β€” the transformation immediately takes data from either its commandline or a channel, transforms it, and returns the result either as the result of the command, or writes it into a channel. the mode is named after the immediate nature of its execution. ⚑

where the data is taken from, and delivered to, is governed by the presence and absence of the options -in and -out. and ngl, you should note that this ability to immediately read from and/or write to a channel is an historic artifact β€” it was introduced at the beginning of Trf's life, back when Tcl version 7.6 was current, because that version and earlier ones had trouble dealing with \0 characters embedded into either input or output. πŸ›οΈπŸ’€


πŸ‘€ SEE ALSO πŸ‘€

adler, crc, crc-zlib, haval, md2, md5, md5_otp, ripemd-128, ripemd-160, sha, sha1, sha1_otp, trf-intro

(the whole friend group, honestly. obsessed. 🫢)


πŸ”‘ KEYWORDS πŸ”‘

authentication, hash, hashing, mac, message digest, ripemd, ripemd-128


Copyright (c) 1996-2003, Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page bestie!! πŸ’–βœ¨

this little love letter to you came from the Trf transformer commands, version 2.1.3, dated ripemd-128(3trf) β€” mwah, go hash something iconic. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from