Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Please help as i cant remember how to do this.....

Please help as i cant remember how to do this.....

Scheduled Pinned Locked Moved C#
questioncomdata-structureshelptutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stephen darling
    wrote on last edited by
    #1

    Dear coders. If you would not mind taking a look at this page... http://www.licenturion.com/xp/fully-licensed-wpa.txt If you see that the installation id is a string of digits, very long... e.g 234344-345656-898909-878766-567676-555655-454334-565556-77 etc When the check digits are removed, it ends up as a 42 digit number, and this is represented as a byte array encoding of this, 17 bytes long. How do i get the above long string of digits into its 17 byte representation? I do not simply want a byte array the same lenght of the string (i.e. 41 digits) I need an actual byte array of 17 digits that represent the numer. Basacaly, i need to be able to generate the byte array of the string above and vice versa (it may be a base-10 representation. If no one can help, how can i do the following? Have a byte array like BYTE[] = {0x44, 0x34, 0x22, 0x47, 0x49, 0x78, 0x54, 0xf3, 0x2a, 0x44, 0x44, 0x28, 0x44, 0x83, 0x33, 0x22, 0x44} 17 bytes, to represent an encoding of a long number of forty something digits in a string of: 034333-495655-345444-090986-091232 etc.... Basacily as in the text above. Thank you Steve

    S A 2 Replies Last reply
    0
    • S stephen darling

      Dear coders. If you would not mind taking a look at this page... http://www.licenturion.com/xp/fully-licensed-wpa.txt If you see that the installation id is a string of digits, very long... e.g 234344-345656-898909-878766-567676-555655-454334-565556-77 etc When the check digits are removed, it ends up as a 42 digit number, and this is represented as a byte array encoding of this, 17 bytes long. How do i get the above long string of digits into its 17 byte representation? I do not simply want a byte array the same lenght of the string (i.e. 41 digits) I need an actual byte array of 17 digits that represent the numer. Basacaly, i need to be able to generate the byte array of the string above and vice versa (it may be a base-10 representation. If no one can help, how can i do the following? Have a byte array like BYTE[] = {0x44, 0x34, 0x22, 0x47, 0x49, 0x78, 0x54, 0xf3, 0x2a, 0x44, 0x44, 0x28, 0x44, 0x83, 0x33, 0x22, 0x44} 17 bytes, to represent an encoding of a long number of forty something digits in a string of: 034333-495655-345444-090986-091232 etc.... Basacily as in the text above. Thank you Steve

      S Offline
      S Offline
      StarBP
      wrote on last edited by
      #2

      There may be something in the GMP Bignum Library that can help you. Try searching the Internet for GMP C# bindings.

      S 1 Reply Last reply
      0
      • S stephen darling

        Dear coders. If you would not mind taking a look at this page... http://www.licenturion.com/xp/fully-licensed-wpa.txt If you see that the installation id is a string of digits, very long... e.g 234344-345656-898909-878766-567676-555655-454334-565556-77 etc When the check digits are removed, it ends up as a 42 digit number, and this is represented as a byte array encoding of this, 17 bytes long. How do i get the above long string of digits into its 17 byte representation? I do not simply want a byte array the same lenght of the string (i.e. 41 digits) I need an actual byte array of 17 digits that represent the numer. Basacaly, i need to be able to generate the byte array of the string above and vice versa (it may be a base-10 representation. If no one can help, how can i do the following? Have a byte array like BYTE[] = {0x44, 0x34, 0x22, 0x47, 0x49, 0x78, 0x54, 0xf3, 0x2a, 0x44, 0x44, 0x28, 0x44, 0x83, 0x33, 0x22, 0x44} 17 bytes, to represent an encoding of a long number of forty something digits in a string of: 034333-495655-345444-090986-091232 etc.... Basacily as in the text above. Thank you Steve

        A Offline
        A Offline
        Alan N
        wrote on last edited by
        #3

        If I wanted to do this I probably would download the source code mentioned in the document, open up main.c, read it, find that the DecodeInstID function implements the algorithm, and then translate that into C#. Is this what you did, but then forgot? Alan.

        S 1 Reply Last reply
        0
        • S StarBP

          There may be something in the GMP Bignum Library that can help you. Try searching the Internet for GMP C# bindings.

          S Offline
          S Offline
          stephen darling
          wrote on last edited by
          #4

          Thank you i will try that, However, there was a simple block of code i found but i cannot find it. Is there some code that will convert/encode a byte array as a BASE-10 encoding, and one to decode. I can find many that will encode my byte array to represent base 24, base 32 or HEX but not a string of digits (base 10) Thank you Steve

          1 Reply Last reply
          0
          • A Alan N

            If I wanted to do this I probably would download the source code mentioned in the document, open up main.c, read it, find that the DecodeInstID function implements the algorithm, and then translate that into C#. Is this what you did, but then forgot? Alan.

            S Offline
            S Offline
            stephen darling
            wrote on last edited by
            #5

            Yes but it has been so long i have forgot my c and i tried that but cant figure it out. Steve

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups