ComfyUI Node

SHAKE Hashing

Hash anything to any length in ComfyUI

By AzelusLightvale·Created 12 months ago·Updated 2 days ago· 1
SHAKE Hashing
  • key
  • hash_bytes
digest_size32
algorithm

SHAKE is the hash you didn't know you needed. SHAKE128 and SHAKE256 are the extendable-output cousins of the SHA-3 family, and unlike SHA-256 - which is welded to exactly 32 bytes - SHAKE lets you ask for any output length you want. That makes this node the "give me a deterministic blob of exactly N bytes" tool, which is a surprisingly useful thing to have hanging off your graph.

It ships in ComfyUI ARG Toolkit by AzelusLightvale, an open-source (GPLv3) hobby pack aimed at making and solving ARGs and secret messages without leaving ComfyUI. The whole Modern/Hashing section is a row of these byte-out nodes, and HashSHAKE is the cleanest entry point to it.

How it works

Under the hood it's a thin wrapper around Python's cryptography library: it builds a SHAKE128 or SHAKE256 sponge, feeds it your key, and finalizes it to exactly digest_size bytes. Nothing clever, nothing network-y - pure local hashing. Same input always gives the same bytes, which is the whole point: you can turn a passphrase or an ARG clue into a key or seed of a fixed size, deterministically.

The inputs that matter

There are only three, and honestly only one of them will ever bite you.

  • key (BYTESLIKE) - mandatory, and it's forceInput, meaning you can't type into the socket. You have to wire a bytes source in. The pack's own Bytes-like Object Encode node converts a normal text string to BYTESLIKE, so the usual setup is: string → encode → here.
  • algorithm - the dropdown: SHAKE128 (128-bit security) or SHAKE256 (256-bit security). For anything not strictly a game, pick SHAKE256.
  • digest_size (INT, default 32, min 1) - the length of output you want, in bytes. 32 bytes matches SHA-256's size if you want something comparable.

One tiny quirk worth knowing: the dropdown's default key is misspelled in the source (defaull instead of default), so the node schema shows no default at all. It still lands on SHAKE128 because that's first in the list - harmless, just looks odd in a workflow file.

What comes out

The single output is hash_bytes (BYTESLIKE) - raw bytes, which the UI can't render as text. To actually read your hash, wire it into the pack's Bytes-like Object Decode node and pick Hexadecimal or Base64. Or skip the human step and feed the bytes straight into another node - the pack's crypto nodes chain on BYTESLIKE, so hash output can become a key or a password without ever touching a string.

Installing it

ComfyUI Manager is the easy path: search "ComfyUI ARG Toolkit" and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit

Then restart ComfyUI. The pack pulls in cryptography, secretpy, stegano, reedsolo and friends. One watch-out: its autogenerated requirements.txt pins exact versions of torch, numpy, and opencv-python. If pip decides your existing versions differ, it may try to swap them - and that's the kind of change that quietly breaks other nodes. Let Manager install it, and if anything starts complaining about torch afterwards, that file is the first place to look.

Troubleshooting

  • "Expected bytes-like objects" error - you fed the key socket something that isn't BYTESLIKE. Route it through Bytes-like Object Encode first.
  • Hash is gibberish when you view it - that's not a bug, that's bytes. Decode as Hexadecimal and compare hex strings.
  • A wall of missing-node errors on a shared workflow - the ARG Toolkit pack wasn't installed. Grab it via Manager's "Install Missing Custom Nodes"; the hashing nodes sit under the ARG Toolkit/Cryptography/Modern/Hashing menu.
CategoryARG Toolkit/Cryptography/Modern/Hashing

Inputs (3)

NameTypeDefaultDescription
keyBYTESLIKEFirst key (mandatory)
digest_sizeINT32The length of output desired (in bytes)
algorithmCOMBOThe algorithm for hashing.

Outputs (1)

NameTypeDescription
hash_bytesBYTESLIKE