Skip to content
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

adding describe function #6

Merged
merged 5 commits into from
Jun 20, 2023
Merged

adding describe function #6

merged 5 commits into from
Jun 20, 2023

Conversation

mfdeveloper508
Copy link
Contributor

No description provided.

formats/iso4.go Outdated Show resolved Hide resolved
describe.go Outdated Show resolved Hide resolved
describe.go Outdated
fmt.Fprintf(tw, "PAD\t: %s\n", iso.Padding(pin))
fmt.Fprintf(tw, "Format\t: %s\n", iso.Format())
fmt.Fprintf(tw, "%s\n", strings.Repeat("-", 36))
fmt.Fprintf(tw, "Clear PIN block\t: %s\n\n", result)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is clear pin block? is it unencrypted value? If so, then for iso4 it will be encrypted.

What's the purpose of the Describe? Do help to debug calculation? If so, then we should find a way to extract into public methods how we calculate pin field and pan field.

As now, the only data that is not the input or output of the Encode/Decode are:

  • Format()
  • Padding()

are we really interested in only those two data points?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#2

clear pin block means encrypted block
main purpose is to provide human-readable format of the encoding inputs and outputs.

ISO interface added to support general interface, format and padding functions are utility functions of the interface

Copy link
Member

Choose a reason for hiding this comment

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

"Cleartext" refers to decrypted data, so "Clear" meaning encrypted is confusing to me.

@alovak
Copy link
Contributor

alovak commented Jun 15, 2023

left a comment here: #2 (comment)

@mfdeveloper508
Copy link
Contributor Author

this logic implemented on format package

formats/iso0.go Outdated Show resolved Hide resolved
formats/iso0.go Outdated Show resolved Hide resolved
formats/iso0.go Outdated Show resolved Hide resolved
formats/iso0.go Outdated Show resolved Hide resolved
formats/iso0.go Outdated Show resolved Hide resolved
formats/iso0.go Outdated Show resolved Hide resolved
formats/iso0.go Outdated Show resolved Hide resolved
formats/iso4_test.go Outdated Show resolved Hide resolved
formats/iso4_test.go Outdated Show resolved Hide resolved
@alovak
Copy link
Contributor

alovak commented Jun 16, 2023

@mfdeveloper508 it looks good! Let's use require.Contains and I think we are good to go! Thank you for your work!!!

@alovak alovak merged commit 83c1bb3 into master Jun 20, 2023
3 checks passed
@alovak alovak deleted the describe-function branch June 20, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants