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

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

  •  
  •   4ra1n · Jun 13, 2024 · 1593 views
    This topic created in 725 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   ·   2993 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 14:36 · PVG 22:36 · LAX 07:36 · JFK 10:36
    ♥ Do have faith in what you're doing.