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

Make all accesses to TPJMD5Digest's fields read only #6

Open
delphidabbler opened this issue Aug 29, 2022 · 5 comments
Open

Make all accesses to TPJMD5Digest's fields read only #6

delphidabbler opened this issue Aug 29, 2022 · 5 comments
Assignees
Labels
considering enhancement New feature or request

Comments

@delphidabbler
Copy link
Member

delphidabbler commented Aug 29, 2022

To do this, the public variant record with Bytes, LongWords and A, B, C, & D fields need to be made private and renamed with f prefixes if necessary.

Then new read-only properties named after the fields need to be created with appropriate private read methods that access the fields. These "getters" could be made inline.

@delphidabbler
Copy link
Member Author

delphidabbler commented Aug 29, 2022

As a consequence the new LongWords[] property could be made the default property and Parts[] could be removed.

@delphidabbler
Copy link
Member Author

NOTE

The above changes are API breaking and require a major version number bump.

@delphidabbler
Copy link
Member Author

Getters for the A, B, C & D fields could have (indexed?) getters that simply read from the appropriate fields of the private version of the LongWords array.

@delphidabbler delphidabbler changed the title Make all accesses to TPJMD5Digest Make all accesses to TPJMD5Digest's fields read only Aug 29, 2022
@delphidabbler delphidabbler added the enhancement New feature or request label Aug 29, 2022
@delphidabbler delphidabbler self-assigned this Aug 29, 2022
@delphidabbler
Copy link
Member Author

As a consequence the new LongWords[] property could be made the default property and Parts[] could be removed

Note that removing Parts[] would be a breaking change.

@delphidabbler
Copy link
Member Author

Note that removing Parts[] would be a breaking change.

Come to think of it, making the fields read only would also be a breaking change, even though there's absolutely no reason for a user to write to them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
considering enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant