diff options
author | Rutger Broekhoff | 2021-05-25 14:38:24 +0200 |
---|---|---|
committer | Rutger Broekhoff | 2021-05-25 14:38:24 +0200 |
commit | 55b14e7fcfa3c340d27107f2b7cdf9836e7c4758 (patch) | |
tree | 76a8c7fd927ae599e26a711b0a0ef01b4c60c3d7 /src/znk.zig | |
parent | e9a14d7f019f264fed826a55294be14b2f37ae76 (diff) | |
download | zig-nkeys-55b14e7fcfa3c340d27107f2b7cdf9836e7c4758.tar.gz zig-nkeys-55b14e7fcfa3c340d27107f2b7cdf9836e7c4758.zip |
Write a few more tests, rename a few functions
Diffstat (limited to 'src/znk.zig')
-rw-r--r-- | src/znk.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/znk.zig b/src/znk.zig index 7837cc8..4ab3077 100644 --- a/src/znk.zig +++ b/src/znk.zig | |||
@@ -149,10 +149,10 @@ pub fn cmdGen(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !voi | |||
149 | } else { | 149 | } else { |
150 | var kp = try nkeys.SeedKeyPair.generate(ty.?); | 150 | var kp = try nkeys.SeedKeyPair.generate(ty.?); |
151 | defer kp.wipe(); | 151 | defer kp.wipe(); |
152 | try stdout.writeAll(&kp.textSeed()); | 152 | try stdout.writeAll(&kp.seedText()); |
153 | try stdout.writeAll("\n"); | 153 | try stdout.writeAll("\n"); |
154 | 154 | ||
155 | var public_key = kp.textPublicKey(); | 155 | var public_key = kp.publicKeyText(); |
156 | if (pub_out) { | 156 | if (pub_out) { |
157 | try stdout.writeAll(&public_key); | 157 | try stdout.writeAll(&public_key); |
158 | try stdout.writeAll("\n"); | 158 | try stdout.writeAll("\n"); |
@@ -378,12 +378,12 @@ const PrefixKeyGenerator = struct { | |||
378 | 378 | ||
379 | var kp = try nkeys.SeedKeyPair.generate(self.ty); | 379 | var kp = try nkeys.SeedKeyPair.generate(self.ty); |
380 | defer kp.wipe(); | 380 | defer kp.wipe(); |
381 | var public_key = kp.textPublicKey(); | 381 | var public_key = kp.publicKeyText(); |
382 | if (!mem.startsWith(u8, public_key[1..], self.prefix)) continue; | 382 | if (!mem.startsWith(u8, public_key[1..], self.prefix)) continue; |
383 | 383 | ||
384 | if (self.done.xchg(true, .SeqCst)) return; // another thread is already done | 384 | if (self.done.xchg(true, .SeqCst)) return; // another thread is already done |
385 | 385 | ||
386 | info("{s}", .{kp.textSeed()}); | 386 | info("{s}", .{kp.seedText()}); |
387 | info("{s}", .{public_key}); | 387 | info("{s}", .{public_key}); |
388 | 388 | ||
389 | return; | 389 | return; |