php - What is the name of this Checksum Algorithm? -


Do anyone know the formal / official name of the checksum algorithm used in the following functions?


function checksum ($ number, $ encod = true) {if ($ encoded === true) {$ result = 0; $ Number = str_split ($ number, 1); Forex Currency ($ number $ value) {$ result = ($ result + command ($ value) - 48) * 10% 97; } Return implode ('', $ number). Sprint ('% 02u', (98 - $ result * 10% 97)% 97); } And if ($ number === checksum (substrate ($ number, 0, -2) is true)) {return substr ($ number, 0, -2); } return false; }
  function ifMB ($ unit, $ reference, $ amount = 0.00) {$ stack = 923; $ Weight = array (62, 45, 53, 15, 50, 5, 49, 34, 81, 76, 27, 9, 9, 30, 3); $ Argument = str_split (sprintf ('% 03u% 04u% 08u', $ unit, $ reference, round ($ amount * 100)), 1); Forex currency ($ argument = $ gt; $ value as the $ key) {$ stack + = $ value * $ weight [$ key]; } Return Sprint ('% 03u% 04u% 02u', $ unit, $ reference, 98 - ($ stack% 97)); }  

Thanks!

There is an error in improving

  • Making a mark invalid <
  • Transposition of two digits (e.g., 1324 in return)
  • Adding or missing a digit

The use of algorithm is mostly bank account number It is done in verification, but you can use it for any string of digits

References:

  • (Code Standard ECC Most of the applicable)
  • (I O Standard page)

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -