Algorithm for document codes?!

Discussion in 'PHP' started by Sephy, May 15, 2008.

  1. #1
    Hello again. So here is my task. I need some algorithm for my documents code. Something similar to algorithm used in credit cards(http://en.wikipedia.org/wiki/Luhn_algorithm). I could use this one but i need something so i can use error correction too :). For correction i will need store some check code for each user. I need this because i want my system could work off-line(for example credit cards are valid when formula for calculation gives out 0). :cool:

    example: user gives 123456789(his real number is 123456788). I check it vs my algorithm correct and give out: correct is 123456788 and there where mistake in 9 position.
     
    Sephy, May 15, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    Such a script could be used to run a bunch of random numbers and then find only the valid ones; not sure if you'll find anyone supporting a way to reverse engineer credit cards like that.
     
    itcn, May 15, 2008 IP
  3. Sephy

    Sephy Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I dont need credit cards i need my word documents number generate like that
     
    Sephy, May 15, 2008 IP
  4. Sephy

    Sephy Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i think for error correction i could use reed-solom codes but i need algorithm for my code word :confused:
     
    Sephy, May 15, 2008 IP
  5. Sephy

    Sephy Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    [​IMG]
     
    Sephy, May 16, 2008 IP