Apologies in advance if the terminology I am using in the title of this question, is flawed.
I want an algorithm that will produce a ternary value (meaning from a set of three, as opposed to from a set of two as is the case with a 1 bit / binary value) given some message (of arbitrary length, much the same way message digest procedures accept such messages).
The required properties of the algorithm mirror requirements on cryptographically secure message digest algorithms:
The algorithm has to be deterministic with respect to input, producing same output for same input
The product of the algorithm must be irreversible to the original message. Arguably, reversing one single ternary bit into some message of any substantial length sounds akin to solving some intractable data compression problem, but just mentioning this for the requirements own sake.
The set of values the algorithm would produce must feature a sufficiently "random" distribution.
Every value would be present in quantities amounting to exactly 1/3 of the set, meaning the algorithm must also feature "fair" distribution of values.
To express this more plainly, perhaps, I am ultimately looking for a message digest algorithm which, instead of yielding some 128-, 256- or any other amount of bits worth of digest, yields one single ternary (as opposed to binary) value/number.
An algorithm that, by extension, turns a product of some existing traditional message digest (e.g. SHA-256) into a ternary value, would suffice, but I am not sure I can, for instance, just divide some 256-bit value by 3 to get me some sufficiently random value distribution. However, piggybacking on an existing, cryptographically secure message digest algorithm, could be a solution in general, I suppose.