10-hash-secretsok
Structure
importhash:lib/hash.mq.mdsec:lib/secrets.mq.md
fn · h1Digests and secure tokens
comment
fn · h1main
bind
`d` = > hash.sha256 text=marqdobind
`t` = > sec.token_hex n=8bind
`L` = > len `t`call
> print text=`d`call
> print text=`L`branch
arm
`L` == 16call
> print text=mid-m3-okarm
elsecall
> print text=mid-m3-failFunctions
Variables
-
L int1616
-
d textf2f787a9d343fec86007178a1735620f2e8f2c9bb472411a934378791e537143f2f787a9d343fec86007178a1735620f2e8f2c9bb472411a934378791e537143
-
t text0f3aa2eed8d161320f3aa2eed8d16132
Execution
f2f787a9d343fec86007178a1735620f2e8f2c9bb472411a934378791e537143
16
mid-m3-ok
Source
--- title: Mid stdlib — hash and secrets description: lib/hash + lib/secrets without plugins (Mid M3) import hash:lib/hash.mq.md import sec:lib/secrets.mq.md --- # Digests and secure tokens Integrity digests and cryptographic tokens stay in `lib/` — do not use `math.random` for secrets. # main **`d` = > hash.sha256 text="marqdo"** **`t` = > sec.token_hex n=8** **`L` = > len `t`** > print text=`d` > print text=`L` 1. `L` == 16 > print text=mid-m3-ok 2. * > print text=mid-m3-fail
Integrity digests and cryptographic tokens stay in
lib/— do not usemath.randomfor secrets.