Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.Base29Safe ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create function "pears"."Base29Safe"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "seed" integer,in "digits" smallint ) returns char(20) begin declare "rv" char(20); declare "m" integer; declare "sdigits" char(29); -- Where the code must be handled by humans, letters O and I can be confused with zero and one so these are left out -- By removing all vowels and also 1 & 0 from the available characters (except the padding) nothing that -- looks much like a word (rude or otherwise) should be generated set "sdigits" = '23456789BCDFGHJKLMNPQRSTVWXYZ'; set "rv" = ''; if(("digits" > 20) or("digits" < 1)) then set "digits" = 20 end if; while "seed" > 0 loop set "m" = "mod"("seed",29); set "rv" = "substr"("sdigits","m"+1,1) || "rv"; set "seed" = "seed"/29 end loop; set "rv" = "right"("string"('0000000000000000000',"rv"),"digits"); return("rv") end </code> database/functions/pears_base29safe.txt Last modified: 2026/08/07 19:24by 127.0.0.1