sample/sample.rs
1// Copyright (c) 2023 Tony Barbitta
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7use tinyid::TinyId;
8
9const ITERS: usize = 100;
10
11fn main() {
12 println!("Generating {ITERS} TinyIds...");
13 for x in (0..(ITERS)).step_by(2) {
14 let id = TinyId::random();
15 let mut n = x + 1;
16 print!("#{n:03}: {id}");
17 print!(" | ");
18 let id = TinyId::random();
19 n += 1;
20 println!("#{n:03}: {id}");
21 }
22}