%% %% This is file `xintbinhex.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% xint.dtx (with options: `xintbinhex') %% %% IMPORTANT NOTICE: %% %% For the copyright see the source file. %% %% Any modified versions of this file must be renamed %% with new filenames distinct from xintbinhex.sty. %% %% For distribution of the original source see the terms %% for copying and modification in the file xint.dtx. %% %% This generated file may be distributed as long as the %% original source files, as listed above, are part of the %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- %% The xint bundle 1.4k 2022/05/18 %% Copyright (C) 2013-2022 by Jean-Francois Burnol %% xintbinhex: Expandable binary and hexadecimal conversions %% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% \catcode13=5 % ^^M \endlinechar=13 % \catcode123=1 % { \catcode125=2 % } \catcode64=11 % @ \catcode35=6 % # \catcode44=12 % , \catcode45=12 % - \catcode46=12 % . \catcode58=12 % : \let\z\endgroup \expandafter\let\expandafter\x\csname ver@xintbinhex.sty\endcsname \expandafter\let\expandafter\w\csname ver@xintkernel.sty\endcsname \expandafter \ifx\csname PackageInfo\endcsname\relax \def\y#1#2{\immediate\write-1{Package #1 Info: #2.}}% \else \def\y#1#2{\PackageInfo{#1}{#2}}% \fi \expandafter \ifx\csname numexpr\endcsname\relax \y{xintbinhex}{\numexpr not available, aborting input}% \aftergroup\endinput \else \ifx\x\relax % plain-TeX, first loading of xintbinhex.sty \ifx\w\relax % but xintkernel.sty not yet loaded. \def\z{\endgroup\input xintkernel.sty\relax}% \fi \else \def\empty {}% \ifx\x\empty % LaTeX, first loading, % variable is initialized, but \ProvidesPackage not yet seen \ifx\w\relax % xintkernel.sty not yet loaded. \def\z{\endgroup\RequirePackage{xintkernel}}% \fi \else \aftergroup\endinput % xintbinhex already loaded. \fi \fi \fi \z% \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xintbinhex}% [2022/05/18 v1.4k Expandable binary and hexadecimal conversions (JFB)]% \newcount\xint_c_ii^xv \xint_c_ii^xv 32768 \newcount\xint_c_ii^xvi \xint_c_ii^xvi 65536 \def\XINT_tmpa #1{\ifx\relax#1\else \expandafter\edef\csname XINT_csdth_#1\endcsname {\endcsname\ifcase #1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or A\or B\or C\or D\or E\or F\fi}% \expandafter\XINT_tmpa\fi }% \XINT_tmpa {0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}\relax \def\XINT_tmpa #1{\ifx\relax#1\else \expandafter\edef\csname XINT_csdtb_#1\endcsname {\endcsname\ifcase #1 0000\or 0001\or 0010\or 0011\or 0100\or 0101\or 0110\or 0111\or 1000\or 1001\or 1010\or 1011\or 1100\or 1101\or 1110\or 1111\fi}% \expandafter\XINT_tmpa\fi }% \XINT_tmpa {0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}\relax \let\XINT_tmpa\relax \expandafter\def\csname XINT_csbth_0000\endcsname {\endcsname0}% \expandafter\def\csname XINT_csbth_0001\endcsname {\endcsname1}% \expandafter\def\csname XINT_csbth_0010\endcsname {\endcsname2}% \expandafter\def\csname XINT_csbth_0011\endcsname {\endcsname3}% \expandafter\def\csname XINT_csbth_0100\endcsname {\endcsname4}% \expandafter\def\csname XINT_csbth_0101\endcsname {\endcsname5}% \expandafter\def\csname XINT_csbth_0110\endcsname {\endcsname6}% \expandafter\def\csname XINT_csbth_0111\endcsname {\endcsname7}% \expandafter\def\csname XINT_csbth_1000\endcsname {\endcsname8}% \expandafter\def\csname XINT_csbth_1001\endcsname {\endcsname9}% \expandafter\def\csname XINT_csbth_1010\endcsname {\endcsname A}% \expandafter\def\csname XINT_csbth_1011\endcsname {\endcsname B}% \expandafter\def\csname XINT_csbth_1100\endcsname {\endcsname C}% \expandafter\def\csname XINT_csbth_1101\endcsname {\endcsname D}% \expandafter\def\csname XINT_csbth_1110\endcsname {\endcsname E}% \expandafter\def\csname XINT_csbth_1111\endcsname {\endcsname F}% \let\XINT_csbth_none \endcsname \expandafter\def\csname XINT_cshtb_0\endcsname {\endcsname0000}% \expandafter\def\csname XINT_cshtb_1\endcsname {\endcsname0001}% \expandafter\def\csname XINT_cshtb_2\endcsname {\endcsname0010}% \expandafter\def\csname XINT_cshtb_3\endcsname {\endcsname0011}% \expandafter\def\csname XINT_cshtb_4\endcsname {\endcsname0100}% \expandafter\def\csname XINT_cshtb_5\endcsname {\endcsname0101}% \expandafter\def\csname XINT_cshtb_6\endcsname {\endcsname0110}% \expandafter\def\csname XINT_cshtb_7\endcsname {\endcsname0111}% \expandafter\def\csname XINT_cshtb_8\endcsname {\endcsname1000}% \expandafter\def\csname XINT_cshtb_9\endcsname {\endcsname1001}% \def\XINT_cshtb_A {\endcsname1010}% \def\XINT_cshtb_B {\endcsname1011}% \def\XINT_cshtb_C {\endcsname1100}% \def\XINT_cshtb_D {\endcsname1101}% \def\XINT_cshtb_E {\endcsname1110}% \def\XINT_cshtb_F {\endcsname1111}% \let\XINT_cshtb_none \endcsname \def\XINT_zeroes_foriv #1#2#3#4#5#6#7#8% {% \xint_gob_til_R #8\XINT_zeroes_foriv_end\R\XINT_zeroes_foriv }% \def\XINT_zeroes_foriv_end\R\XINT_zeroes_foriv #1#2\W {\XINT_zeroes_foriv_done #1}% \def\XINT_zeroes_foriv_done #1\R{ #1}% \def\xintDecToHex {\romannumeral0\xintdectohex }% \def\xintdectohex #1% {% \expandafter\XINT_dth_checkin\romannumeral`&&@#1\xint: }% \def\XINT_dth_checkin #1% {% \xint_UDsignfork #1\XINT_dth_neg -{\XINT_dth_main #1}% \krof }% \def\XINT_dth_neg {\expandafter-\romannumeral0\XINT_dth_main}% \def\XINT_dth_main #1\xint: {% \expandafter\XINT_dth_finish \romannumeral`&&@\expandafter\XINT_dthb_start \romannumeral0\XINT_zeroes_foriv #1\R{0\R}{00\R}{000\R}\R{0\R}{00\R}{000\R}\R\W #1\xint_bye\XINT_dth_tohex }% \def\XINT_dthb_start #1#2#3#4#5% {% \xint_bye#5\XINT_dthb_small\xint_bye\XINT_dthb_start_a #1#2#3#4#5% }% \def\XINT_dthb_small\xint_bye\XINT_dthb_start_a #1\xint_bye#2{#2#1!}% \def\XINT_dthb_start_a #1#2#3#4#5#6#7#8#9% {% \expandafter\XINT_dthb_again\the\numexpr\expandafter\XINT_dthb_update \the\numexpr#1#2#3#4% \xint_bye#9\XINT_dthb_lastpass\xint_bye #5#6#7#8!\XINT_dthb_exclam\relax\XINT_dthb_nextfour #9% }% \def\XINT_dthb_exclam {!\XINT_dthb_exclam\relax \expandafter\XINT_dthb_update\the\numexpr}% \def\XINT_dthb_update #1!% {% \expandafter\XINT_dthb_update_a \the\numexpr (#1+\xint_c_ii^xv)/\xint_c_ii^xvi-\xint_c_i\xint: #1\xint:% }% \def\XINT_dthb_update_a #1\xint:#2\xint:#3% {% 0000+#1\expandafter#3\the\numexpr#2-#1*\xint_c_ii^xvi }% \def\XINT_dthb_nextfour #1#2#3#4#5% {% \xint_bye#5\XINT_dthb_lastpass\xint_bye #1#2#3#4!\XINT_dthb_exclam\relax\XINT_dthb_nextfour#5% }% \def\XINT_dthb_lastpass\xint_bye #1!#2\xint_bye#3{#1!#3!}% \def\XINT_dth_tohex {% \expandafter\expandafter\expandafter\XINT_dth_tohex_a\csname\XINT_tofourhex }% \def\XINT_dth_tohex_a\endcsname{!\XINT_dth_tohex!}% \def\XINT_dthb_again #1!#2#3% {% \ifx#3\relax \expandafter\xint_firstoftwo \else \expandafter\xint_secondoftwo \fi {\expandafter\XINT_dthb_again \the\numexpr \ifnum #1>\xint_c_ \xint_afterfi{\expandafter\XINT_dthb_update\the\numexpr#1}% \fi}% {\ifnum #1>\xint_c_ \xint_dothis{#2#1!}\fi\xint_orthat{!#2!}}% }% \def\XINT_tofourhex #1!% {% \expandafter\XINT_tofourhex_a \the\numexpr (#1+\xint_c_ii^vii)/\xint_c_ii^viii-\xint_c_i\xint: #1\xint: }% \def\XINT_tofourhex_a #1\xint:#2\xint: {% \expandafter\XINT_tofourhex_c \the\numexpr (#1+\xint_c_viii)/\xint_c_xvi-\xint_c_i\xint: #1\xint: \the\numexpr #2-\xint_c_ii^viii*#1!% }% \def\XINT_tofourhex_c #1\xint:#2\xint: {% XINT_csdth_#1% \csname XINT_csdth_\the\numexpr #2-\xint_c_xvi*#1\relax \csname \expandafter\XINT_tofourhex_d }% \def\XINT_tofourhex_d #1!% {% \expandafter\XINT_tofourhex_e \the\numexpr (#1+\xint_c_viii)/\xint_c_xvi-\xint_c_i\xint: #1\xint: }% \def\XINT_tofourhex_e #1\xint:#2\xint: {% XINT_csdth_#1% \csname XINT_csdth_\the\numexpr #2-\xint_c_xvi*#1\endcsname }% \def\XINT_dth_finish !\XINT_dth_tohex!#1#2#3% {% \unless\if#10\xint_dothis{ #1#2#3}\fi \unless\if#20\xint_dothis{ #2#3}\fi \unless\if#30\xint_dothis{ #3}\fi \xint_orthat{ }% }% \def\xintDecToBin {\romannumeral0\xintdectobin }% \def\xintdectobin #1% {% \expandafter\XINT_dtb_checkin\romannumeral`&&@#1\xint: }% \def\XINT_dtb_checkin #1% {% \xint_UDsignfork #1\XINT_dtb_neg -{\XINT_dtb_main #1}% \krof }% \def\XINT_dtb_neg {\expandafter-\romannumeral0\XINT_dtb_main}% \def\XINT_dtb_main #1\xint: {% \expandafter\XINT_dtb_finish \romannumeral`&&@\expandafter\XINT_dthb_start \romannumeral0\XINT_zeroes_foriv #1\R{0\R}{00\R}{000\R}\R{0\R}{00\R}{000\R}\R\W #1\xint_bye\XINT_dtb_tobin }% \def\XINT_dtb_tobin {% \expandafter\expandafter\expandafter\XINT_dtb_tobin_a\csname\XINT_tosixteenbits }% \def\XINT_dtb_tobin_a\endcsname{!\XINT_dtb_tobin!}% \def\XINT_tosixteenbits #1!% {% \expandafter\XINT_tosixteenbits_a \the\numexpr (#1+\xint_c_ii^vii)/\xint_c_ii^viii-\xint_c_i\xint: #1\xint: }% \def\XINT_tosixteenbits_a #1\xint:#2\xint: {% \expandafter\XINT_tosixteenbits_c \the\numexpr (#1+\xint_c_viii)/\xint_c_xvi-\xint_c_i\xint: #1\xint: \the\numexpr #2-\xint_c_ii^viii*#1!% }% \def\XINT_tosixteenbits_c #1\xint:#2\xint: {% XINT_csdtb_#1% \csname XINT_csdtb_\the\numexpr #2-\xint_c_xvi*#1\relax \csname \expandafter\XINT_tosixteenbits_d }% \def\XINT_tosixteenbits_d #1!% {% \expandafter\XINT_tosixteenbits_e \the\numexpr (#1+\xint_c_viii)/\xint_c_xvi-\xint_c_i\xint: #1\xint: }% \def\XINT_tosixteenbits_e #1\xint:#2\xint: {% XINT_csdtb_#1% \csname XINT_csdtb_\the\numexpr #2-\xint_c_xvi*#1\endcsname }% \def\XINT_dtb_finish !\XINT_dtb_tobin!#1#2#3#4#5#6#7#8% {% \expandafter\XINT_dtb_finish_a\the\numexpr #1#2#3#4#5#6#7#8\relax }% \def\XINT_dtb_finish_a #1{% \def\XINT_dtb_finish_a ##1##2##3##4##5##6##7##8##9% {% \expandafter#1\the\numexpr ##1##2##3##4##5##6##7##8##9\relax }}\XINT_dtb_finish_a { }% \def\xintHexToDec {\romannumeral0\xinthextodec }% \def\xinthextodec #1% {% \expandafter\XINT_htd_checkin\romannumeral`&&@#1\xint: }% \def\XINT_htd_checkin #1% {% \xint_UDsignfork #1\XINT_htd_neg -{\XINT_htd_main #1}% \krof }% \def\XINT_htd_neg {\expandafter-\romannumeral0\XINT_htd_main}% \def\XINT_htd_main #1\xint: {% \expandafter\XINT_htd_startb \the\numexpr\expandafter\XINT_htd_starta \romannumeral0\XINT_zeroes_foriv #1\R{0\R}{00\R}{000\R}\R{0\R}{00\R}{000\R}\R\W #1\xint_bye!2!3!4!5!6!7!8!9!\xint_bye\relax }% \def\XINT_htd_starta #1#2#3#4{"#1#2#3#4+100000!}% \def\XINT_htd_startb 1#1% {% \if#10\expandafter\XINT_htd_startba\else \expandafter\XINT_htd_startbb \fi 1#1% }% \def\XINT_htd_startba 10#1!{\XINT_htd_again #1% \xint_bye!2!3!4!5!6!7!8!9!\xint_bye\XINT_htd_nextfour}% \def\XINT_htd_startbb 1#1#2!{\XINT_htd_again #1!#2% \xint_bye!2!3!4!5!6!7!8!9!\xint_bye\XINT_htd_nextfour}% \def\XINT_htd_again #1\XINT_htd_nextfour #2% {% \xint_bye #2\XINT_htd_finish\xint_bye \expandafter\XINT_htd_A\the\numexpr \XINT_htd_a #1\XINT_htd_nextfour #2% }% \def\XINT_htd_a #1!#2!#3!#4!#5!#6!#7!#8!#9!% {% #1\expandafter\XINT_htd_update \the\numexpr #2\expandafter\XINT_htd_update \the\numexpr #3\expandafter\XINT_htd_update \the\numexpr #4\expandafter\XINT_htd_update \the\numexpr #5\expandafter\XINT_htd_update \the\numexpr #6\expandafter\XINT_htd_update \the\numexpr #7\expandafter\XINT_htd_update \the\numexpr #8\expandafter\XINT_htd_update \the\numexpr #9\expandafter\XINT_htd_update \the\numexpr \XINT_htd_a }% \def\XINT_htd_nextfour #1#2#3#4% {% *\xint_c_ii^xvi+"#1#2#3#4+1000000000\relax\xint_bye!% 2!3!4!5!6!7!8!9!\xint_bye\XINT_htd_nextfour }% \def\XINT_htd_update 1#1#2#3#4#5%#6!% {% *\xint_c_ii^xvi+10000#1#2#3#4#5!%#6!% }% \def\XINT_htd_A 1#1% {% \if#10\expandafter\XINT_htd_Aa\else \expandafter\XINT_htd_Ab \fi 1#1% }% \def\XINT_htd_Aa 10#1#2#3#4{\XINT_htd_again #1#2#3#4!}% \def\XINT_htd_Ab 1#1#2#3#4#5{\XINT_htd_again #1!#2#3#4#5!}% \def\XINT_htd_finish\xint_bye \expandafter\XINT_htd_A\the\numexpr \XINT_htd_a #1\XINT_htd_nextfour {% \expandafter\XINT_htd_finish_cuz\the\numexpr0\XINT_htd_unsep_loop #1% }% \def\XINT_htd_unsep_loop #1!#2!#3!#4!#5!#6!#7!#8!#9!% {% \expandafter\XINT_unsep_clean \the\numexpr 1#1#2\expandafter\XINT_unsep_clean \the\numexpr 1#3#4\expandafter\XINT_unsep_clean \the\numexpr 1#5#6\expandafter\XINT_unsep_clean \the\numexpr 1#7#8\expandafter\XINT_unsep_clean \the\numexpr 1#9\XINT_htd_unsep_loop_a }% \def\XINT_htd_unsep_loop_a #1!#2!#3!#4!#5!#6!#7!#8!#9!% {% #1\expandafter\XINT_unsep_clean \the\numexpr 1#2#3\expandafter\XINT_unsep_clean \the\numexpr 1#4#5\expandafter\XINT_unsep_clean \the\numexpr 1#6#7\expandafter\XINT_unsep_clean \the\numexpr 1#8#9\XINT_htd_unsep_loop }% \def\XINT_unsep_clean 1{\relax}% also in xintcore \def\XINT_htd_finish_cuz #1{% \def\XINT_htd_finish_cuz ##1##2##3##4##5% {\expandafter#1\the\numexpr ##1##2##3##4##5\relax}% }\XINT_htd_finish_cuz{ }% \def\xintBinToDec {\romannumeral0\xintbintodec }% \def\xintbintodec #1% {% \expandafter\XINT_btd_checkin\romannumeral`&&@#1\xint: }% \def\XINT_btd_checkin #1% {% \xint_UDsignfork #1\XINT_btd_N -{\XINT_btd_main #1}% \krof }% \def\XINT_btd_N {\expandafter-\romannumeral0\XINT_btd_main }% \def\XINT_btd_main #1\xint: {% \csname XINT_btd_htd\csname\expandafter\XINT_bth_loop \romannumeral0\XINT_zeroes_foriv #1\R{0\R}{00\R}{000\R}\R{0\R}{00\R}{000\R}\R\W #1\xint_bye2345678\xint_bye none\endcsname\xint: }% \def\XINT_btd_htd #1\xint: {% \expandafter\XINT_htd_startb \the\numexpr\expandafter\XINT_htd_starta \romannumeral0\XINT_zeroes_foriv #1\R{0\R}{00\R}{000\R}\R{0\R}{00\R}{000\R}\R\W #1\xint_bye!2!3!4!5!6!7!8!9!\xint_bye\relax }% \def\xintBinToHex {\romannumeral0\xintbintohex }% \def\xintbintohex #1% {% \expandafter\XINT_bth_checkin\romannumeral`&&@#1\xint: }% \def\XINT_bth_checkin #1% {% \xint_UDsignfork #1\XINT_bth_N -{\XINT_bth_main #1}% \krof }% \def\XINT_bth_N {\expandafter-\romannumeral0\XINT_bth_main }% \def\XINT_bth_main #1\xint: {% \csname space\csname\expandafter\XINT_bth_loop \romannumeral0\XINT_zeroes_foriv #1\R{0\R}{00\R}{000\R}\R{0\R}{00\R}{000\R}\R\W #1\xint_bye2345678\xint_bye none\endcsname }% \def\XINT_bth_loop #1#2#3#4#5#6#7#8% {% XINT_csbth_#1#2#3#4% \csname XINT_csbth_#5#6#7#8% \csname\XINT_bth_loop }% \def\xintHexToBin {\romannumeral0\xinthextobin }% \def\xinthextobin #1% {% \expandafter\XINT_htb_checkin\romannumeral`&&@#1% \xint_bye 23456789\xint_bye none\endcsname }% \def\XINT_htb_checkin #1% {% \xint_UDsignfork #1\XINT_htb_N -{\XINT_htb_main #1}% \krof }% \def\XINT_htb_N {\expandafter-\romannumeral0\XINT_htb_main }% \def\XINT_htb_main {\csname XINT_htb_cuz\csname\XINT_htb_loop}% \def\XINT_htb_loop #1#2#3#4#5#6#7#8#9% {% XINT_cshtb_#1% \csname XINT_cshtb_#2% \csname XINT_cshtb_#3% \csname XINT_cshtb_#4% \csname XINT_cshtb_#5% \csname XINT_cshtb_#6% \csname XINT_cshtb_#7% \csname XINT_cshtb_#8% \csname XINT_cshtb_#9% \csname \XINT_htb_loop }% \def\XINT_htb_cuz #1{% \def\XINT_htb_cuz ##1##2##3##4% {\expandafter#1\the\numexpr##1##2##3##4\relax}% }\XINT_htb_cuz { }% \def\xintCHexToBin {\romannumeral0\xintchextobin }% \def\xintchextobin #1% {% \expandafter\XINT_chtb_checkin\romannumeral`&&@#1% \xint_bye 23456789\xint_bye none\endcsname }% \def\XINT_chtb_checkin #1% {% \xint_UDsignfork #1\XINT_chtb_N -{\XINT_chtb_main #1}% \krof }% \def\XINT_chtb_N {\expandafter-\romannumeral0\XINT_chtb_main }% \def\XINT_chtb_main {\csname space\csname\XINT_htb_loop}% \XINTrestorecatcodesendinput% \endinput %% %% End of file `xintbinhex.sty'.