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

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

  •  
  •   4ra1n · Jun 13, 2024 · 1609 views
    This topic created in 734 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   ·   1049 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:49 · PVG 06:49 · LAX 15:49 · JFK 18:49
    ♥ Do have faith in what you're doing.