authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 23:47:26 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 23:47:26 -07:00
logfa67fd84a2cc9db16685220fcec1abd5cb8b6546
tree37c51fa81d6df0be60251b730ff5ddc599174363
parent09882358129ac88cecdea8808a47c3d3d7903d02
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

update to zig 0.15.2


2 files changed, 3 insertions(+), 3 deletions(-)

README.md+1-1
...@@ -3,7 +3,7 @@...@@ -3,7 +3,7 @@
3![loc](https://sloc.xyz/github/nektro/zig-totp)3![loc](https://sloc.xyz/github/nektro/zig-totp)
4[![license](https://img.shields.io/github/license/nektro/zig-totp.svg)](https://github.com/nektro/zig-totp/blob/master/LICENSE)4[![license](https://img.shields.io/github/license/nektro/zig-totp.svg)](https://github.com/nektro/zig-totp/blob/master/LICENSE)
5[![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro)5[![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro)
6[![Zig](https://img.shields.io/badge/Zig-0.14-f7a41d)](https://ziglang.org/)6[![Zig](https://img.shields.io/badge/Zig-0.15-f7a41d)](https://ziglang.org/)
7[![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod)7[![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod)
88
9RFC 6238: TOTP: Time-Based One-Time Password Algorithm9RFC 6238: TOTP: Time-Based One-Time Password Algorithm
totp.zig+2-2
...@@ -56,7 +56,7 @@ pub fn generateUrl(allocator: std.mem.Allocator, issuer: []const u8, account: []...@@ -56,7 +56,7 @@ pub fn generateUrl(allocator: std.mem.Allocator, issuer: []const u8, account: []
56 std.debug.assert(secret_raw.len <= algo.digest_length());56 std.debug.assert(secret_raw.len <= algo.digest_length());
57 std.debug.assert(digits == 6 or digits == 7 or digits == 8);57 std.debug.assert(digits == 6 or digits == 7 or digits == 8);
58 std.debug.assert(period == 15 or period == 30 or period == 60);58 std.debug.assert(period == 15 or period == 30 or period == 60);
59 var list: std.ArrayList(u8) = .init(allocator);59 var list: std.array_list.Managed(u8) = .init(allocator);
60 errdefer list.deinit();60 errdefer list.deinit();
61 try list.appendSlice("otpauth://");61 try list.appendSlice("otpauth://");
62 try list.appendSlice("totp/");62 try list.appendSlice("totp/");
...@@ -78,7 +78,7 @@ pub fn generateUrl(allocator: std.mem.Allocator, issuer: []const u8, account: []...@@ -78,7 +78,7 @@ pub fn generateUrl(allocator: std.mem.Allocator, issuer: []const u8, account: []
7878
79// RFC3548 base3279// RFC3548 base32
80// input.len is gonna be 64 | 32 | 6480// input.len is gonna be 64 | 32 | 64
81fn encodeBase32(list: *std.ArrayList(u8), input: []const u8) !void {81fn encodeBase32(list: *std.array_list.Managed(u8), input: []const u8) !void {
82 const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";82 const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
83 var iter = BufBiterator.init(input);83 var iter = BufBiterator.init(input);
84 while (iter.nextInt(u5)) |idx| try list.append(alphabet[idx]);84 while (iter.nextInt(u5)) |idx| try list.append(alphabet[idx]);