Byte.Length

imclever1205
Member Posts: 94
Hi Guys ,
I am writing a function to calculate MD5 Hash in Navision.
I am taking a .net code as reference but I got stuck on a code which goes like
byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
then
data.Length
So I declared a variable called VarByte in Nav of Datatype DotNet and Subtype System.Byte.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' then System.Byte
My problem is that when I do VarByte .Length is does not recognise this property .
Even I set the dimension on the variable it gives me the same error.
If I try to declare my variable as byte directly ,it does not accept the previous code I wrote i.e
VarByte:=md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input)); It throws an error of Invalid Datatype From Byte to DotNet
Does anyone know how to get the length of a byte variable in Navision ?
I am writing a function to calculate MD5 Hash in Navision.
I am taking a .net code as reference but I got stuck on a code which goes like
byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
then
data.Length
So I declared a variable called VarByte in Nav of Datatype DotNet and Subtype System.Byte.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' then System.Byte
My problem is that when I do VarByte .Length is does not recognise this property .
Even I set the dimension on the variable it gives me the same error.
If I try to declare my variable as byte directly ,it does not accept the previous code I wrote i.e
VarByte:=md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input)); It throws an error of Invalid Datatype From Byte to DotNet
Does anyone know how to get the length of a byte variable in Navision ?
0
Comments
-
Hi
Try This code.Name DataType Subtype Length MD5 DotNet System.Security.Cryptography.MD5.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' BTcon DotNet System.BitConverter.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' SInStream InStream HashKey Text 50 GetMD5Hash(SEntry : Record "S Entry") : Text[50] SEntry.CALCFIELDS(SBLOB); IF SEntry.SBLOB.HASVALUE THEN BEGIN SEntry.SBLOB.CREATEINSTREAM(SInStream); MD5:=MD5.Create(); MD5.ComputeHash(SInStream); HashKey:= BTcon.ToString(MD5.ComputeHash(SInStream)); HashKey:=DELCHR(HashKey, '=', '-'); EXIT(HashKey); END ELSE EXIT('');
0 -
thanks buddy0
-
Is System.Security.Cryptography.MD5.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' part of Net Framework 4.6? I cannot find it with framework 4.5.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions