greatroar
1e2379df1b
lib/protocol: faster Luhn algorithm and better testing ( #6475 )
...
The previous implementation was very generic; its tests didn't cover the
actual alphabet for device IDs.
Benchmark results on amd64:
name old time/op new time/op delta
Luhnify-8 1.00µs ± 1% 0.28µs ± 4% -72.38% (p=0.000 n=9+10)
Unluhnify-8 992ns ± 2% 274ns ± 1% -72.39% (p=0.000 n=10+9)
2020-03-29 22:28:04 +02:00
..
2019-12-04 10:46:55 +01:00
2020-03-17 07:40:52 +01:00
2020-01-24 08:35:44 +01:00
2020-01-24 08:35:44 +01:00
2019-11-06 10:53:10 +00:00
2019-11-06 10:53:10 +00:00
2019-12-04 10:46:55 +01:00
2015-09-22 19:34:29 +02:00
2016-07-04 10:40:29 +00:00
2018-12-18 12:36:38 +01:00
2019-07-13 14:05:39 +01:00
2019-10-04 13:03:34 +02:00
2019-02-02 11:45:17 +01:00
2019-10-18 09:53:59 +02:00
2019-01-14 11:53:36 +01:00
2020-03-29 22:28:04 +02:00
2015-09-22 19:34:29 +02:00
2018-10-21 16:08:14 +01:00
2019-02-02 11:45:17 +01:00
2020-03-03 22:40:00 +01:00
2015-09-22 19:34:29 +02:00
2020-03-29 22:28:04 +02:00
2020-03-29 22:28:04 +02:00
2019-12-04 10:46:55 +01:00
2016-04-15 10:59:41 +00:00
2018-11-13 08:53:55 +01:00
2019-12-04 10:46:55 +01:00
2020-03-17 07:40:52 +01:00
2020-03-29 17:09:53 +01:00
2018-12-18 12:36:38 +01:00
2018-12-18 12:36:38 +01:00
2019-11-25 11:07:36 +01:00