Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spider-gazelle/verhoeff
implementation of the Verhoeff checksum algorithm in crystal lang
https://github.com/spider-gazelle/verhoeff
Last synced: 3 months ago
JSON representation
implementation of the Verhoeff checksum algorithm in crystal lang
- Host: GitHub
- URL: https://github.com/spider-gazelle/verhoeff
- Owner: spider-gazelle
- License: mit
- Created: 2023-10-11T23:05:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-11T23:31:45.000Z (about 1 year ago)
- Last Synced: 2024-06-21T18:12:43.801Z (5 months ago)
- Language: Crystal
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - verhoeff - Implementation of the Verhoeff checksum algorithm (Algorithms and Data structures)
README
# verhoeff
An implementation of the [verhoeff algorithm](https://en.wikibooks.org/wiki/Algorithm_Implementation/Checksums/Verhoeff_Algorithm) for crystal lang
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
verhoeff:
github: spider-gazelle/verhoeff
```2. Run `shards install`
## Usage
```crystal
require "verhoeff"puts Verhoeff.generate_checksum(1234) # => 0
puts Verhoeff.validate(12340) # => trueputs Verhoeff.generate_checksum("1234") # => 0
puts Verhoeff.validate("12340") # => true
```## Contributors
- [Stephen von Takach](https://github.com/stakach) - creator and maintainer