crypto.random(n)n bytes from the browser's secure source, as hex. The one call here that cannot fail.
n16 bytes
hex
be3a0ad384db9caecc2e4c577596808a
32 hex digits: two for each byte
crypto.argon2idA key from a password and a salt: slow and memory-hungry on purpose. Mote's own wasm, run in a worker, so the page stays live while it works.
password
salt (eight bytes or more)
memory19456 KiB (19 MiB)
time2 passes
parallelism1 lane
length32 bytes
the key, as hex
Press the button.
bytes
A run of bytes is a value of its own. A page cannot show one as it is: pick a form.
bytes("text") and its formsThe text's UTF-8. An arrow or an accent takes more than one byte: try some.
b.hex()
4d 6f 74 65 20 e2 86 92 20 62 79 74 65 73
b.base64()
TW90ZSDihpIgYnl0ZXM=
14b.length12 letters
77b[0]a number, 0 to 255
Mote → bytesb.text()back to the text
iwhich byte b[i] reads
from0
to4
b.slice(0, 4)
4d 6f 74 65
its text()
Mote
A slice that cuts a letter in half shows a replacement mark.
bytes.hex(s) and bytes.base64(s)They read the two forms back into bytes, and can fail: what is typed may not be hex or base64. Break one to see.
hex
4 bytes
"Mote"
base64
14 bytes
"Mote batteries"
b.url()An address for some bytes, with a type if wanted: a picture's src, a link's href. Here the picture is SVG text made by the page, then turned to bytes.