Importer, Bürokraten, Moderatoren (CommentStreams), Strukturierte-Diskussionen-Bots, Oberflächenadministratoren, Push-Abonnementverwalter, Oversighter, Administratoren, Kampagnenbearbeiter (Hochladeassistent)
855
Bearbeitungen
(+cu.getNbnDeCheckDigit( urn )) |
K (51 Versionen von wikivoyage:Modul:Citation/utilities importiert) |
||
| (7 dazwischenliegende Versionen von einem anderen Benutzer werden nicht angezeigt) | |||
| Zeile 3: | Zeile 3: | ||
suite = 'Citation', | suite = 'Citation', | ||
sub = 'utilities', | sub = 'utilities', | ||
serial = '2022- | serial = '2022-10-21' | ||
} | } | ||
| Zeile 12: | Zeile 12: | ||
-- module import | -- module import | ||
require( ' | -- require( 'strict' ) | ||
local ci = require( 'Module:Citation/i18n' ) | local ci = require( 'Module:Citation/i18n' ) | ||
| Zeile 279: | Zeile 279: | ||
end | end | ||
-- Check digit estimation for countries at, ch, de, and fi | |||
-- See: https://github.com/bohnelang/URN-Pruefziffer | -- See: https://github.com/bohnelang/URN-Pruefziffer | ||
function cu. | -- Description of the algorithm: http://www.pruefziffernberechnung.de/U/URN.shtml | ||
function cu.getNbnCheckDigit( urn ) | |||
-- two-digits codes for ascii characters starting from - == '-' | |||
local code='3947450102030405060708094117############1814191516212223242542262713282931123233113435363738########43' | local code='3947450102030405060708094117############1814191516212223242542262713282931123233113435363738########43' | ||
local sum = 0 | local sum = 0 | ||
| Zeile 301: | Zeile 304: | ||
end | end | ||
function cu. | function cu.check_UrnNbn( urn ) | ||
return urn:sub( -1 ) == cu. | urn = urn:gsub( '/fragment/.+$', '' ) -- remove fragment | ||
return urn:sub( -1 ) == cu.getNbnCheckDigit( urn ) | |||
end | end | ||
return cu | return cu | ||