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.Base34 ====== <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"."Base34"( /* 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(34); -- 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 base34 set "sdigits" = '0123456789ABCDEFGHJKLMNPQRSTUVWXYZ'; set "rv" = ''; if(("digits" > 20) or("digits" < 1)) then set "digits" = 20 end if; while "seed" > 0 loop set "m" = "mod"("seed",34); set "rv" = "substr"("sdigits","m"+1,1) || "rv"; set "seed" = "seed"/34 end loop; while "length"("rv") < "digits" loop set "rv" = '0' || "rv" end loop; return("rv") end </code> database/functions/pears_base34.txt Last modified: 2026/08/07 19:24by 127.0.0.1