"auto" — the default: "native" when the runtime provides it, "js"
otherwise.
"js" — pure-JS (js-sha256). Works in every runtime including the
browser and React Native. Slow (~5-10× slower than native at MB+
payloads).
"native" — node:cryptocreateHash, obtained from the runtime with
process.getBuiltinModule(): Node (20.16+, 22.3+), Deno and Bun, with no
extra dependency. It isn't imported, so bundles for the browser or React
Native don't reference node:crypto. Selecting it where it isn't
available throws at the first put/get.
SHA-256 backend selector.
"auto"— the default:"native"when the runtime provides it,"js"otherwise."js"— pure-JS (js-sha256). Works in every runtime including the browser and React Native. Slow (~5-10× slower than native at MB+ payloads)."native"—node:cryptocreateHash, obtained from the runtime withprocess.getBuiltinModule(): Node (20.16+, 22.3+), Deno and Bun, with no extra dependency. It isn't imported, so bundles for the browser or React Native don't referencenode:crypto. Selecting it where it isn't available throws at the first put/get.