# pg_luhn A pure SQL implementation of the [Luhn Algorithm] [Luhn Algorithm]: https://en.wikipedia.org/wiki/Luhn_algorithm ## Example ```sql SELECT luhn_verify(5432); luhn_verify ------------- f (1 row) SELECT luhn_verify(5439); luhn_verify ------------- t (1 row) postgres=# SELECT luhn_generate(543); luhn_generate --------------- 5439 ``` ## Install ``` make make install ``` Once the extension is installed on the server, you can create it inside the database. ```sql CREATE EXTENSION pg_luhn; ``` ## Credits This extension is based on the [work of Craig Ringer] published on the [PostgreSQL Wiki] [work of Craig Ringer]: https://www.postgresql.org/message-id/4A091D25.6070108@postnewspapers.com.au [PostgreSQL Wiki]: https://wiki.postgresql.org/wiki/Luhn_algorithm