Files
herolib/examples/data/resp/resp_example.vsh
2025-10-12 12:30:19 +03:00

21 lines
472 B
GLSL
Executable File

#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
import incubaid.herolib.data.resp
import crypto.ed25519
mut b := resp.builder_new()
b.add(resp.r_list_string(['a', 'b']))
b.add(resp.r_int(10))
b.add(resp.r_ok())
// to get some binary
pubkey, privkey := ed25519.generate_key()!
b.add(resp.r_bytestring(privkey))
// b.data now has the info as binary data
// println(b.data)
println(b.data.bytestr())
lr := resp.decode(b.data)!
println(lr)