• 请不要在回答技术问题时复制粘贴 AI 生成的内容
4ra1n
V2EX  ›  程序员

摸鱼写的 Java 随机数相关工具

  •  
  •   4ra1n · Jun 13, 2024 · 1684 views
    This topic created in 769 days ago, the information mentioned may be changed or developed.

    https://github.com/4ra1n/JRandom

    核心是 RDRAND 指令

    get_rand_int:
        test rdi, rdi
        je fail
        rdrand eax
        jc success
    fail:
        xor eax, eax
        ret
    success:
        mov [rdi], eax
        mov eax, 1
        ret
    

    然后 JNI 提供给 Java 层简单封装一些方法

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5713 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 85ms · UTC 06:26 · PVG 14:26 · LAX 23:26 · JFK 02:26
    ♥ Do have faith in what you're doing.