| ... | ... | @@ -56,7 +56,7 @@ pub fn generateUrl(allocator: std.mem.Allocator, issuer: []const u8, account: [] |
| 56 | 56 | std.debug.assert(secret_raw.len <= algo.digest_length()); |
| 57 | 57 | std.debug.assert(digits == 6 or digits == 7 or digits == 8); |
| 58 | 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 | 60 | errdefer list.deinit(); |
| 61 | 61 | try list.appendSlice("otpauth://"); |
| 62 | 62 | try list.appendSlice("totp/"); |
| ... | ... | @@ -78,7 +78,7 @@ pub fn generateUrl(allocator: std.mem.Allocator, issuer: []const u8, account: [] |
| 78 | 78 | |
| 79 | 79 | // RFC3548 base32 |
| 80 | 80 | // input.len is gonna be 64 | 32 | 64 |
| 81 | | fn encodeBase32(list: *std.ArrayList(u8), input: []const u8) !void { |
| 81 | fn encodeBase32(list: *std.array_list.Managed(u8), input: []const u8) !void { |
| 82 | 82 | const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; |
| 83 | 83 | var iter = BufBiterator.init(input); |
| 84 | 84 | while (iter.nextInt(u5)) |idx| try list.append(alphabet[idx]); |