OverviewFilesCommitsIssuesDocsReleasesPeers

apds commits / 8d896b1

move try catch into bog5 open
8d896b18353a7941755273172a316ea2b4935b6a
by Ev Bogue <ev@evbogue.com> · 2024-12-21T01:28:35.000Z

Changed files (1) +8 -4

bogbot.js +8 -4
……@@ -61,12 +61,16 @@ bogbot.sign = async (data) => {
6161}
6262
6363bogbot.open = async (msg) => {
64 const pubkey = msg.substring(0, 44)
65 const sig = msg.substring(44)
64 try {
65 const pubkey = msg.substring(0, 44)
66 const sig = msg.substring(44)
6667
67 const opened = new TextDecoder().decode(nacl.sign.open(decode(sig), decode(pubkey)))
68 const opened = new TextDecoder().decode(nacl.sign.open(decode(sig), decode(pubkey)))
6869
69 return opened
70 return opened
71 } catch (err) {
72 console.log('Not a valid Bog5 protocol message')
73 }
7074}
7175
7276import { yaml } from './lib/yaml.js'