Parsing String to Integer... Value changes!

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 818 Views - Last Post: 14 August 2012 - 02:13 PM Rate Topic: -----

#16 qwertyuu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 31-July 12

Re: Parsing String to Integer... Value changes!

Posted 14 August 2012 - 01:33 PM

View PostAdamSpeight2008, on 14 August 2012 - 01:29 PM, said:

Not sure of what uint is. Then a useful skill to learn in Research.

Check the C# Documentation on MSDN

yep, went on google and found it right away... thanks for the whole Table, been searching this for a while!

So if I get it right, it's like an int32... but values are shifted so the minimum value is 0?

but, why would I use this... if my encrypted password is very very secure and goes over the 4,294,967,295 limit?
Was This Post Helpful? 0
  • +
  • -

#17 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 2035
  • View blog
  • Posts: 6,058
  • Joined: 05-May 12

Re: Parsing String to Integer... Value changes!

Posted 14 August 2012 - 01:54 PM

The point I was trying to make was that instead of using IntX.Parse(a) that you use IntX.Parse(a, 10) to force IntX to use base 10 parsing instead of its current behavior of detecting based on the leading characters.

This post has been edited by Skydiver: 14 August 2012 - 01:55 PM

Was This Post Helpful? 1
  • +
  • -

#18 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 2035
  • View blog
  • Posts: 6,058
  • Joined: 05-May 12

Re: Parsing String to Integer... Value changes!

Posted 14 August 2012 - 02:00 PM

As a side note, I hope that you do know that by limiting your cleartext alphabet to the values 10-35, 40-49, and 36 you are narrowing the search space for an attacker and thereby making it easier to try to break your encryption. Yes, I know that are only just experimenting with encryption, but this is something to bear in mind.
Was This Post Helpful? 1
  • +
  • -

#19 qwertyuu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 31-July 12

Re: Parsing String to Integer... Value changes!

Posted 14 August 2012 - 02:00 PM

View PostSkydiver, on 14 August 2012 - 01:54 PM, said:

The point I was trying to make was that instead of using IntX.Parse(a) that you use IntX.Parse(a, 10) to force IntX to use base 10 parsing instead of its current behavior of detecting based on the leading characters.

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhh!
And this... would work for encrypting and decrypting on the other side? Say I create a decrypter that took the base 10 value and reversed the maths... would I still have the 0112 as a result?
Was This Post Helpful? 0
  • +
  • -

#20 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 2035
  • View blog
  • Posts: 6,058
  • Joined: 05-May 12

Re: Parsing String to Integer... Value changes!

Posted 14 August 2012 - 02:03 PM

View Postqwertyuu, on 14 August 2012 - 02:00 PM, said:

View PostSkydiver, on 14 August 2012 - 01:54 PM, said:

The point I was trying to make was that instead of using IntX.Parse(a) that you use IntX.Parse(a, 10) to force IntX to use base 10 parsing instead of its current behavior of detecting based on the leading characters.

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhh!
And this... would work for encrypting and decrypting on the other side? Say I create a decrypter that took the base 10 value and reversed the maths... would I still have the 0112 as a result?


That is only for parsing.

I've not dug into the IntX to see if there is a way to tell it to put leading 0's to pad numbers when converting from its internal representation to a string. At best, you'll get the value 112. The question is if you'll be able to generate the string "0112" again from the 112 value.
Was This Post Helpful? 0
  • +
  • -

#21 qwertyuu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 31-July 12

Re: Parsing String to Integer... Value changes!

Posted 14 August 2012 - 02:13 PM

View PostSkydiver, on 14 August 2012 - 02:03 PM, said:

View Postqwertyuu, on 14 August 2012 - 02:00 PM, said:

View PostSkydiver, on 14 August 2012 - 01:54 PM, said:

The point I was trying to make was that instead of using IntX.Parse(a) that you use IntX.Parse(a, 10) to force IntX to use base 10 parsing instead of its current behavior of detecting based on the leading characters.

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhh!
And this... would work for encrypting and decrypting on the other side? Say I create a decrypter that took the base 10 value and reversed the maths... would I still have the 0112 as a result?


That is only for parsing.

I've not dug into the IntX to see if there is a way to tell it to put leading 0's to pad numbers when converting from its internal representation to a string. At best, you'll get the value 112. The question is if you'll be able to generate the string "0112" again from the 112 value.



The thing is... if I don't have this 0 value on decryption, it may crash or shift the values so at some point I don't have the right letters showing up
This means... I should totally eradicate the 0's so I don't have to mess with the "is there a 0 there, or is there nothing at all?".
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2