Skip to content

[pkg/ottl] add LuhnValid function #38353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Mar 17, 2025

Conversation

bacherfl
Copy link
Contributor

@bacherfl bacherfl commented Mar 4, 2025

Description

This PR adds the Luhn function which can be used to verify the checksum of e.g. credit card numbers, as discussed in the related issue

Link to tracking issue

Fixes #37880

Testing

Added Unit and E2E tests

Documentation

Described the new function in the readme

@bacherfl bacherfl marked this pull request as ready for review March 5, 2025 07:53
@bacherfl bacherfl requested a review from a team as a code owner March 5, 2025 07:53
@bacherfl bacherfl changed the title [pkg/ottl] add Luhn function [pkg/ottl] add LuhnValid function Mar 10, 2025
Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OTTL bits look right, I can't validate if the algorithm is implemented correctly.

Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran a quick check of the algorithm, works with my credit card numbers. 👍

@evan-bradley evan-bradley merged commit f9791a7 into open-telemetry:main Mar 17, 2025
171 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider adding a mod() function or similar to OTTL
4 participants