1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: change optional to result in most of the libraries (#16123)

This commit is contained in:
yuyi
2022-10-21 03:14:33 +08:00
committed by GitHub
parent 0d368562f4
commit 51f4d99399
75 changed files with 439 additions and 446 deletions

View File

@@ -8,11 +8,11 @@ import crypto.ed25519
fn main() {
msg := 'Hello Girl'
publ, priv := ed25519.generate_key()?
publ, priv := ed25519.generate_key()!
m := msg.bytes()
sig := ed25519.sign(priv, m)?
sig := ed25519.sign(priv, m)!
println('=== Message ===')
println('Msg: $msg \nHash: $m')
@@ -31,7 +31,7 @@ fn main() {
println('signature: R=${sig[0..32].hex()} s=${sig[32..64].hex()}')
println(' signature (Base64)=${base64.encode(sig)}')
rtn := ed25519.verify(publ, m, sig)?
rtn := ed25519.verify(publ, m, sig)!
if rtn {
println('Signature verified :$rtn')