Java z-base-32 编码算法

发布于 2024-08-09 21:35:38 字数 141 浏览 10 评论 0原文

我正在寻找 z-base-32 enc algo 在java中,有什么建议吗? (编码和解码)

I'm searching for an implementation of z-base-32 enc algo in java, any suggestions?
(encoding and decoding)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月牙弯弯 2024-08-16 21:35:39

我没有比较,但它看起来像我们这里使用的 Base32。这是原始代码,

http://svn.savannah.gnu.org/svn/ccrtp/tags/release-ccrtp-1.7.0/contributions/ZRTP4J/src/gnu/java/zrtp/ utils/Base32.java

I didn't compare but it looks like the Base32 we use here. Here is the original code,

http://svn.savannah.gnu.org/svn/ccrtp/tags/release-ccrtp-1.7.0/contributions/ZRTP4J/src/gnu/java/zrtp/utils/Base32.java

朕就是辣么酷 2024-08-16 21:35:38

好吧,我觉得我必须尝试一下。我将 C# 实现从 我的十便士 翻译为 Java,并且 可以从此处下载示例和源代码。这不是特别好看的代码,但是嘿 - 希望它能起作用。

我还没有时间彻底测试它,但我的简短测试工作得很好。

用法:

import se.welcomweb.utils.zbase32j;

public class TestZBase32J {

    public static void main(String ... args) {

        ZBase32j zbase = new ZBase32j();

        String message = "Hello, world!";
        String encoded = zbase.encode(message);
        System.out.println("Encoded: " + encoded);

        String decoded = zbase.decode(encoded);
        System.out.println("Decoded: " + decoded);

    }

}

Ok, I felt I had to give this a shot. I translated the C# implementation from My Ten Pennies to Java, and an example and source an be downloaded from here. It's not especially good looking code, but hey - it hopefully does it's work.

I haven't had time to test it thoroughly, but my short tests work fine.

Usage:

import se.welcomweb.utils.zbase32j;

public class TestZBase32J {

    public static void main(String ... args) {

        ZBase32j zbase = new ZBase32j();

        String message = "Hello, world!";
        String encoded = zbase.encode(message);
        System.out.println("Encoded: " + encoded);

        String decoded = zbase.decode(encoded);
        System.out.println("Decoded: " + decoded);

    }

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文