patrickfav / base122-java Goto Github PK
View Code? Open in Web Editor NEWA Base122 byte-to-text encoder using format referenced in http://blog.kevinalbs.com/base122
License: Apache License 2.0
A Base122 byte-to-text encoder using format referenced in http://blog.kevinalbs.com/base122
License: Apache License 2.0
I cloned the repo and ran the test package. I like the Monte-Carlo nature of the tests!
Decoder:
Failures:
DecoderTest.decode:16 arrays first differed at element [0]; expected:<68> but was:<-2>
Encoder:
Failures:
EncoderTest.testVector1:20 expected:<[��v�� J#�(�0CADn�;1ƍG�8|E��� ���m0��� @0�Ɔ�A``@( ƅ�!�PP�����q
0�ƅBaPtJ�ʆd1X, �21�R*�F#ri@Z(� %�I#�[�
�8��Ƅ�B0P(ҨʅCρ P(�ƅ�A P(�ƅ�A P(�ƅ�A P(�ƅ�A P(�ƅ�A P(�ƅ�A P(�ƅ�G���B���È@�D�@?| ¶�à��������� ���Ao~��À ����������4�à�� ��S=U�oRQʺMf+B0GJTcP>Q;�Py֦Mz�L��GN!j�9TV��ngOC�M�k:=E>s(+�8g�| À��@ ������� ��� �ΰ)�(Ι�{ ��� P��f9MS<o�j6To�fy3U%r+BeS)y�g<�O>dSD8-A�i9Xn5�sZC6L���1)k�mnXU2JY!H%Җ[2x!RK0=*~�hd}Jí+^7HT�[)I����(�m���*Dsy�B<yӵ�0>s�˅6 Ohl�XaTK,S�rӎ��^e�>�Zu��.hZ}Ӎ!^�m1r U�| ¨�À��������~h�À
� |���q� D��������� ?{ ��À'��D������Á@@8������� DDH���ң8d҃� e�Pl?}P��Àãx�pw�֥c�yF}kFo]4I4]/Y�T<R֍Q c{-ӥ5VA0W<�DÈX%)�<Ӵ�C9sί>)S4>JM�1N6�ƂW,BU��yP^=ǏBm�JE���lU2Y_p�(�-JBx(J U%4<_p�.'GQ��Y�@�cU.j
Hnc:kƱfA4:Pm@nmH^Ɣ/o_Fs.�GyM'� +63�b_�q�À��À ��������À�� E�Q0ְ�ˇ#�m�����H>h2n 4q�J�{Q@zgf>�%@<.Ҩ7Oj/gz)��yRZ+aDVZh)?Ά��Ƃ�F�D�WB�� ?8(��}
9RxBmhg8�O�-M?;6�pB4<j�5)s�0W֗��HiN2:{lRhKiaL?lXVq�v7/m!uj+h4gpM�L=֮g|ãEDS �NPh2^+��9Bw3V(k�o6���p+c֥_v^�(�2�IL^AG���;K+�2�uǭt5)(Pt2aO0n˕Ϣlʺ
vs�b�!M~b�SsfU'�4�à��������Pq�as�K�| ¨�À��������~h�À
� | ��q� D��������� ?{ ��À'q��D����À��������Ҕ���Q8d4���ΐp|?}P��À�xBkY9d�p>+Av�ΕSk�P�^X�a9y�i��+=F<viґʟ8f6@����4?;���S?+.և�Ps�לu�%�2Mog˸mW�q_p�rҷ�:��)@� F6 ]ֿE�ƿ+cƗ1*�:SK|3R,/Mo-ҝLl�m(H{�pzLAD�fm�@�� PMʍa<;a�-.2�zo�à2E�I? |3Ij�E!���,�e�ǥ�u��Vgeiқnao�xN� ]�(8_'vq8-0-#�n�^L'�...> but was:<[�v�~� J#�(
��� ���m0��� @0�Ɔ�A``@( ƅ�!�PP�����q0�ƅBaPtJ�ʆd1
X, �21�R�F#ri@Z(� %�I#�[�`�8��Ƅ�B0P(ҨʅCρ P(�ƅ�A P(�ƅ�A P(�ƅ�A P(�ƅ�A P(�ƅ�A P(�ƅ�A P(�ƅ�G���B���È@�D�@?| ¶�à��������� ���A`o��À ����������4�à�� ��S=U�oRQʺMf+B0GJTcP>Q;�Py֦Mz�L��GN!j�9TV��ngOC�M�k:=E>s(+�8g�| À��@ ������� ��� �ΰ)�(Ι�{ ��� P��f9MS<o�j6To�fy3U%r+BeS)y�g<�O>dSD8-A�i9Xn5�sZC6L���1)k�mnXU2JY!H%Җ[2x!RK0=~�hd}Jí+^7HT�[)I����(�m���Dsy�B<yӵ�0>s�˅6 Ohl�XaTK,S�rӎ��^e�>�Zu��.hZ}Ӎ!^�m1r U�| ¨�À��������h�À`� |���q� D��������� ?{ ��À'��D������Á@@8������� DDH���ң8d҃� e�Pl?}P��Àãx�pw�֥c�yF}kFo]4I4]/Y�T<R֍Q c{-ӥ5VA0W<�DÈX%)�<Ӵ�C9sί>)S4>JM�1N6�ƂW,BU��yP^=ǏBm�JE���`lU2Y_p�(�-JBx(J U%4<_p�.'GQ��Y�@�cU.j`Hnc:kƱfA4:Pm@nmH^Ɣ/o_Fs.�GyM'� +63�b_�q�À��À ��������À�� E�Q0ְ�ˇ#�m�����H>h2n 4q�J�{Q@zgf>�%@<`.Ҩ7Oj/gz)��yRZ+aDVZh)?Ά��Ƃ�F�D�WB�� ?8(��}`9RxBmhg8�O�-M?;6�pB4<j�5)s�0W֗��HiN2:`{lRhKiaL?lXVq�v7/m!uj+h4gpM�L=֮g|ãEDS �NPh2^+��9Bw3V(k�o6���p+c֥_v^�(�2�IL^AG���;K+�2�uǭt5)(Pt2aO0n˕Ϣlʺ`vs�b�!~ �0CADn�;1ƍG�8|E`Mb�SsfU'�4�à��������Pq�as�K�| ¨�À��������h�À`� | ��q� D��������� ?{ ��À'q��D����À��������Ҕ���Q8d4���ΐp|?}P��À�xBkY9d�p>+Av�ΕSk�P�^X�a9y�i��+=F<viґʟ8f6@�`���4?;���S?+.և�Ps�לu�%�2Mog˸mW�q_p�rҷ�:��)@� F6 ]ֿE�ƿ+cƗ1�:SK|3R,/Mo-ҝLl�m(H{�pzLAD�fm�@�� PMʍa<;a�-.2�zo�à2E�I? |3Ij�E!���,�e�ǥ�u��Vgeiқnao�xN� ]�(8_'vq8-0-#�n�^L'�...>
To loop through the UTF-8 encoded string, you should use:
char[] utf8Bytes = base122Data.toCharArray();
instead of:
byte[] utf8Bytes = base122Data.getBytes(StandardCharsets.UTF_8);
Because a byte can only represent a partial UTF-8 character and the range of a byte is -128 to 127, so in line 128, the if statement will always be false (a byte will never larger than 127).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.