Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,28 @@
test: procedure options(main);
declare s character (20) varying;
declare c character (1);
declare v fixed binary (31);
declare (i, k) fixed binary;
get edit (s) (L);
s = trim (s);
v = 0;
do i = 1 to length(s);
c = substr(s, i, 1);
k = index('0123456789abcdef', c);
if k > 0 then v = v*16 + k - 1;
end;
put skip data (s, v);
/* Convert back to hex */
declare hex character(16) initial ('0123456789abcdef');
declare hs character (20) initial ('');
declare d fixed binary;
do i = length(hs) to 1 by -1 until (v = 0);
d = mod(v, 16) + 1;
substr(hs, i, 1) = substr(hex, d, 1);
v = v/16;
end;
put skip list (hs);
end test;