ripemd-160(3trf)
π NAME π
ripemd-160 β a message digest, literally called "ripemd-160". that's it, that's the name. and this right here is the ripemd-160(3trf) page, bestie, so buckle up. π¦
β¨ SYNOPSIS β¨
package require Tcl ?8.2?
package require Trf ?2.1.3?
ripemd-160 ?options...? ?data?
πΈ DESCRIPTION πΈ
okay so ripemd-160 is one of several message digests handed out by the package trf. want the whole-package tour? go read trf-intro, it's the overview of everything trf does. π
ripemd-160 ?options...? ?data?
the options listed below are understood by the digest if and only if the digest is attached to a channel. and if "attached" has you confused, don't worry, there's a whole section later called IMMEDIATE versus ATTACHED that explains the term. π«Ά
-mode absorb|write|transparentβ this one has to be present. not optional, periodt. the argument you give it decides how the digest behaves in attached mode.
and beyond the three values listed above, all unique abbreviations are recognized too. here's what they actually 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 β essentially attaching the value of the digest after the information that was actually written to the channel. π
when you're reading from the channel, a value for the digest gets computed too, and after the channel is closed it's compared to the digest that 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 that comparison. that result is a string, and it's either "ok", or "failed". no in-between, it's giving binary. π
- 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. the generated values for the digest, though, are handled the same way as for write. honestly the main character of modes. π
-matchflag varnameβ can be used if and only if the option-mode absorbis present. in that situation the argument is the name of a global or namespaced variable, and the digest writes the result of comparing two digest values into that variable. heads up: the option gets ignored if the channel is write-only, because in that case there will be no comparison of digest values at all. π-write-type variable|channelβ this one's for digests in modewriteortransparent. 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 tovariable. πΈ-read-type variable|channelβ same energy as option-write-type, but for option-read-destination.-write-destination dataβ usable for digests in modewriteortransparent. the value data is either the name of a global (or namespaced) variable or the handle of a writable channel, dependent on the value of option-write-type. the message digest computed for data written to the attached channel gets written into it after the attached channel was closed. the option is ignored if the channel is read-only.
π¨ note that using a variable may yield incorrect results undertcl 7.6, due to embedded\0's.
-read-destination dataβ usable for digests in modewriteortransparent. the value data is either the name of a global (or namespaced) variable or the handle of a writable channel, dependent on the value of option-read-type. the message digest computed for data read from the attached channel gets 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 undertcl 7.6, due to embedded\0's.
and these next ones? always understood by the digest, attached versus immediate does not matter. if those two words are giving you a headache, the IMMEDIATE versus ATTACHED section explains them. π
-attach channelβ the presence or absence of this option is literally what 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 this in section IMMEDIATE versus ATTACHED.
- if it's absent, the transformation is used in immediate mode and the options listed below are recognized. more about this in section IMMEDIATE versus ATTACHED.
-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. and 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 π
want extra reading? see http://www.esat.kuleuven.ac.be/%7Ebosselae/ripemd160.html for additional information. that's the spot. π¦
π IMMEDIATE VERSUS ATTACHED π
so the transformation distinguishes between two main ways of using it: the immediate and attached operation modes. let's break it down, no gatekeeping.
for attached mode you use the option -attach to associate the transformation with an existing channel. during the execution of the command, no transformation is performed β instead the channel gets changed in such a way that from then on, all data written to or read from it passes through the transformation and gets modified by it according to the definition above. π
and you can revoke that attachment by executing the command unstack for the chosen channel. that is the only way to do it at the Tcl level, so don't go hunting for another route, bestie.
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. iconic naming honestly.
where the data is taken from, and delivered to, is governed by the presence and absence of the options -in and -out. and just so you know: this ability to immediately read from and/or write to a channel is an historic artifact, introduced at the beginning of Trf's life when Tcl version 7.6 was current, because that version and earlier ones have trouble dealing with \0 characters embedded into either input or output. vintage, but we respect it. π°οΈ
π SEE ALSO π
adler, crc, crc-zlib, haval, md2, md5, md5_otp, ripemd-128, ripemd-160, sha, sha1, sha1_otp, trf-intro
π KEYWORDS π
authentication, hash, hashing, mac, message digest, ripemd, ripemd-160
Β©οΈ COPYRIGHT Β©οΈ
Copyright (c) 1996-2003, Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page, bestie! π this came to you straight from the Trf transformer commands, version 2.1.3, on the ripemd-160(3trf) page. now go hash something, you absolute legend. πβ¨
π¦ where this page comes from
- debian bookworm: tcl-trf-doc 2.1.4-dfsg3-2.1
- debian trixie: tcl-trf-doc 2.1.4-dfsg3-8
- ubuntu jammy: tcl-trf-doc 2.1.4-dfsg3-2.1build1
- ubuntu noble: tcl-trf-doc 2.1.4-dfsg3-3
- ubuntu questing: tcl-trf-doc 2.1.4-dfsg3-8
- ubuntu resolute: tcl-trf-doc 2.1.4-dfsg3-8build1
- ubuntu stonking: tcl-trf-doc 2.1.4-dfsg3-9build1
- Copyright (c) 1996-2003, Andreas Kupries <andreas_kupries@users.sourceforge.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms