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

Feature Request: Hash-Functions in AL #212

Closed
hemisphera opened this issue Jun 25, 2018 · 3 comments
Closed

Feature Request: Hash-Functions in AL #212

hemisphera opened this issue Jun 25, 2018 · 3 comments

Comments

@hemisphera
Copy link
Contributor

I have already requested this on Yammer, but I now have a very specific case where I need this: Regarding my issue #2699, I would like to become the primary key for Table 49 to be a 40 character hash string that is generated out of a number of fields, instead of concatenating the various fields together (and probably blows the 250 character limit). But we do not have any access to hash functions, be it MD5, SHA-1 or anything.

I've recently noticed the Codeunits in range 3000 .. 3026 that neatly wrap .NET features in C/AL Codeunits and thus allowing us to use them. Please add another Codeunit here that provides us with simplified access to hashing functions that take 1 string and return 1 string. Something like this:

CalculateSHA256(Value : Text) : Text
enc := enc.UTF8;
SHA256 := SHA256.SHA256Managed();
ba := enc.GetBytes(Value);
ba := SHA256.ComputeHash(ba);
EXIT(GetHexString(ba));
@pzentner
Copy link

@hemisphera Hash Functions exist already in codeunit 1266.

@hemisphera
Copy link
Contributor Author

@pzentner Lovely. Haven't noticed. That is exactly what I was looking for.

I just think it should be exposed "more clearly". I mean: is it just coincidence that that function is there and public? Will it still be there tomorrow? I would've expected it to be a dedicated Codeunit...

@StanislawStempin StanislawStempin transferred this issue from microsoft/AL Nov 1, 2018
@JesperSchulz
Copy link
Contributor

Sounds as if this issue has been resolved :-) Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants